Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hi there,

 

I tried to use an index.php_0.html without the $content tag because I want to add my own content (flash) on the main catalog page. The problem is that the manufacturer box doesnt work any longer since there is no $content. I thought the index.php_0.html should ONLY affect my main catalog page.. Can I somehow use a different template for the categories? I also tried to upload an index.php.html (note that its a different file) WITH the $content tag but it still doesnt work.

 

Please help me, the shop is supposed to be up and live in the weekend. Thanks!

Edited by Fredrik.r
Link to comment
Share on other sites

Hiya!

 

I'm using the latest 2.01 version of STS. I was wondering if there was any way I could actually change the output of $myaccountlogoff to display images instead of text! My site is nettik.co.uk, and I was trying to add a login/logout button in the menu bar.

 

I tried just coding PHP into the template, changing the file extension to .php and updating configure.php, but it merely printed out the php code instead of running it!! I'm a little stuck!!

 

Thx in advance ;)

 

Rich

Link to comment
Share on other sites

I have a missing page in my store and I womder if its a bug in STS.

 

If a guest clicks checkout, there is a line of text that tells you that your "visitor cart" and "member cart" will be merged, with a more info link.

 

If I click that link I get a pop-up window containing just my STS template with no content. Also the window is fixed size so if there was any content you would need to scroll down and across to read it.

 

Is this a problem with my store, STS or osCommerce? And how can I fix it.

 

Thanks - Craig

Link to comment
Share on other sites

Sorry I have more questions.

 

Is there any way to have a static categories box?

 

In my STS template I have included a static products box with a list of products which I had planned to use instead of the catagories box, the problem I have is that because the links are static and do not include session ID values my visitors are logged out when they click on them.

 

My problem with $categorybox is that one of my catogries has so many sub catogries that it expands to far down the page.

 

Is there any way to add session ID values to my links?

 

My site can be seen Here I have included both boxes. Click on ProClips in the categories box to see the over expantion.

Edited by SoundsAlarming
Link to comment
Share on other sites

Sorry I have more questions.

 

Is there any way to have a static categories box?

 

In my STS template I have included a static products box with a list of products which I had planned to use instead of the catagories box, the problem I have is that because the links are static and do not include session ID values my visitors are logged out when they click on them.

 

My problem with $categorybox is that one of my catogries has so many sub catogries that it expands to far down the page.

 

Is there any way to add session ID values to my links?

 

My site can be seen Here I have included both boxes. Click on ProClips in the categories box to see the over expantion.

Yep, just use the $sid variable.

 

at the end of your URL., like this:

 

http://domain.com/catalog/script.php?$sid

 

or

 

http://domain.com/catalog/script.php?var=val&$sid

 

if your URL already has parameters.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Ok new at this I installed a fresh copy of oscommerce and tried installing the newest sts. I installed my catalog into my root directory so that i wouldn't have to mess with redirects and stuff like that but now when i install sts it gives me this

 

Fatal error: Call to a member function on a non-object in /home/chexter/public_html/includes/classes/shopping_cart.php on line 75

 

i am thinking this is because i do not have my files under the catalog folder but then again i could be wrong i did install those extra lines under the config.php so i don't know what else could be the problem. any help is appreciated thanks

Link to comment
Share on other sites

hi, where is all the variable listed in sts_templates_html called from? how about making a new variable? Please help

Check out the following posts in this thread:

 

http://www.oscommerce.com/forums/index.php?sho...ndpost&p=232735

http://www.oscommerce.com/forums/index.php?sho...ndpost&p=308077

http://www.oscommerce.com/forums/index.php?sho...ndpost&p=306849

 

You define custom boxes in sts_user_code.php. The readme file has more detailed info in it, but you essentially turn the capture on, call the code you want to capture, give it a variable name, turn off the capture and parse the variable. The variables are set in sts_display_output.php and in sts_user_code.php. It's possible to use the capture code framework used in sts_user_code.php elsewhere, as long as you're mindful of the capture flow described in the other post and change as needed.

 

You can't add code to the template and change the extension to php and have it work because the template is never executed in the code - it's just loaded into a string variable and the variables are merged into it in sts_display_output.php.

 

-C

Link to comment
Share on other sites

Hi, I'm trying to user Ultrapics with STS. Basically, I've added new template variables into product_info.php.html template (because that's where the extra pics are supposed to appear). However, it isn't a straight <img> link because there is a javascript pop-up involved. I tried loading the code (the <a>, javascript, <img>) into a string variable for example called $image1, but when I load the page, even though with the debug on, it shows that $image1 =

 

<a href="javascript:popupWindow('http://www.mydomain.com/popup_image.php?pID=29ℑ=1');"><img src="images/pl_62.jpg" border="0" alt="Bags 1" title=" Bags 1 " width="120" height="90" hspace="1" vspace="1"></a>

 

on the page itself it is still printing $image1 instead of the string above.

 

When it is a straight off image link, say $image2 =

 

<img src="images/theflowerisattackingme.gif" border="0" alt="" width="600" height="600">

 

the picture loads. So it's not that the variables are not being captured.

 

Any help with this would be MUCH appreciated

Link to comment
Share on other sites

Forgot to mention that you can also directly assign template variables by simply using $template['variablename'] = "Your Content Here"; for whatever you want placed in that space. My bad for omitting this.

 

-C

Link to comment
Share on other sites

Hye guys , I using ultra pics withn sts too and my problem is : No addcional pics shown above description . You guys have any idea where can I start to serch for the error ?

 

thanks very mush

cass

Link to comment
Share on other sites

Hi guys,

 

I've tried running the template files as suggested, I'm getting the following message when I preview the web site...

 

1046 - No Database Selected

 

select configuration_key as cfgKey, configuration_value as cfgValue from configuration

 

[TEP STOP]

 

Any ideas? I Used the Easy Installation method.

 

Any suggestions would be greatfully appreciated.

Link to comment
Share on other sites

Hi guys,

 

I've tried running the template files as suggested, I'm getting the following message when I preview the web site...

 

1046 - No Database Selected

 

select configuration_key as cfgKey, configuration_value as cfgValue from configuration

 

[TEP STOP]

 

Any ideas? I Used the Easy Installation method.

 

Any suggestions would be greatfully appreciated.

 

My guess is that you copied configure-SAMPLE.php over top of your configure.php file and clobbered all your database settings. You need to go to your configure.php file and reenter your database (and possibly directory and other) settings.

 

You normally should only copy the STS stuff at the bottom of configure-SAMPLE.php to the bottom of your configure.php file.

 

Hope this helps.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Hiya!

 

I'm using the latest 2.01 version of STS. I was wondering if there was any way I could actually change the output of $myaccountlogoff to display images instead of text! My site is nettik.co.uk, and I was trying to add a login/logout button in the menu bar.

 

I tried just coding PHP into the template, changing the file extension to .php and updating configure.php, but it merely printed out the php code instead of running it!! I'm a little stuck!!

 

Thx in advance

 

Rich

Edited by richm
Link to comment
Share on other sites

Hi, I'm trying to user Ultrapics with STS. Basically, I've added new template variables into product_info.php.html template (because that's where the extra pics are supposed to appear). However, it isn't a straight <img> link because there is a javascript pop-up involved. I tried loading the code (the <a>, javascript, <img>) into a string variable for example called $image1, but when I load the page, even though with the debug on, it shows that $image1 =

 

<a href="javascript:popupWindow('http://www.mydomain.com/popup_image.php?pID=29ℑ=1');"><img src="images/pl_62.jpg" border="0" alt="Bags 1" title=" Bags 1 " width="120" height="90" hspace="1" vspace="1"></a>

 

on the page itself it is still printing $image1 instead of the string above.

 

When it is a straight off image link, say $image2 =

 

<img src="images/theflowerisattackingme.gif" border="0" alt="" width="600" height="600">

 

the picture loads. So it's not that the variables are not being captured.

 

Any help with this would be MUCH appreciated

 

In the convergence of laziness and the fact that I hate pop-up windows the Product_Info templates do not support javascript, which may be part of your problem. To support popups, I would have to write code to parse through the script looking for any javascript functions in the output and move them to the $headercontent variable. I was trying to get STS 2.x out the door and didn't figure it would be a big deal.

 

You can probably remove the javascript function call and make it work by doing something like this:

 

Change

<a href="javascript:popupWindow('http://www.mydomain.com/popup_image.php?pID=29ℑ=1');"><img src="images/pl_62.jpg" border="0" alt="Bags 1" title=" Bags 1 " width="120" height="90" hspace="1" vspace="1"></a>

 

to this:

 

<a href="javascript:window.open("http://www.mydomain.com/popup_image.php?pID=29ℑ=1","win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable
=1,width=600,height=450');"><img src="images/pl_62.jpg" border="0" alt="Bags 1" title=" Bags 1 " width="120" height="90" hspace="1" vspace="1"></a>

 

I haven't tested this yet, but it could be a starting point to get you going. Sorry I don't have more details, but I haven't worked on Ultrapics yet.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Hiya!

 

I'm using the latest 2.01 version of STS. I was wondering if there was any way I could actually change the output of $myaccountlogoff to display images instead of text! My site is nettik.co.uk, and I was trying to add a login/logout button in the menu bar.

 

I tried just coding PHP into the template, changing the file extension to .php and updating configure.php, but it merely printed out the php code instead of running it!! I'm a little stuck!!

 

Thx in advance 

 

Rich

Around line 202 of sts_display_output.php you'll find this code:

 

  if (tep_session_is_registered('customer_id')) {

    $template['myaccount'] = '<a href=' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_MY_ACCOUNT . '</a>';

    $template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');

    $template['logoff'] = '<a href=' . tep_href_link(FILENAME_LOGOFF, '', 'SSL')  . ' class="headerNavigation">' . HEADER_TITLE_LOGOFF . '</a>';

    $template['urllogoff'] = tep_href_link(FILENAME_LOGOFF, '', 'SSL');

    $template['myaccountlogoff'] = $template['myaccount'] . " | " . $template['logoff'];

  } else {

    $template['myaccount'] = '<a href=' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_MY_ACCOUNT . '</a>';

    $template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');

    $template['logoff'] = '';

    $template['urllogoff'] = '';

    $template['myaccountlogoff'] = $template['myaccount'];

 

You'll want to change these lines in bold to show whatever image tags you want to use in your menu bar.

 

FYI, You can't put PHP code in the template files. The template files are simply read in (as text files) by STS and then displayed to the browser after the variables are replaced. No code in them is actually executed anywhere.

 

This help?

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Is there a way to make a tempate for the pages relating to the Information Box different than your other template files.  I know now with 2.0 you can do this with categories but can you do it with shipping.php, conditions.php, etc?

Yep. Just make a shipping.php.html file or whatever you want and it should use it automatically. Just name the template after the script file (scriptfilename.php.html) and it should work.

 

- Brian

Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://www.oscommerce.com/forums/index.php?showtopic=58541

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...