Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

I posted this before but I have not gotten any help... any ideas on this one... I've tried several things but none have had any success.

 

-----------------------------------------------------------------------------------------------

 

Great Template System...

 

Seems to work great on the index.php page but when I click on something like 'My Account' the template "explodes".

 

Heres an example... www.golfsbestdeal.com/wed (this is my testing site).

 

(And yes I know it looks like crap right now just trying to get sts working correctly)

 

Click on the above link then click on 'my account'...

 

Can anyone direct me to the answer? I installed the latest version of sts and I'm only using 1 template.

 

Thanks in advance!

Hi,

 

tried your site but everything went OK ! I also installed an account (Rolf Schmitz) and got forward until the last process in buying...

So what?s your problem ?

 

byps

That's weird!

 

If I go to the site... www.golfsbestdeal.com/wed everything looks ok but if I go anywhere else in the site other than the index.php, the graphics go crazy.

 

Are you sure you went to the right site? There are 2 sites using that URL... www.golfsbestdeal.com/catalog and www.golfsbestdeal.com/wed

 

Thanks again for any help,

Darren


DJ

 

"I wake in a cold sweat every night with visions of code in my head" AHHHHHHH!

Share this post


Link to post
Share on other sites

is it possible for me to add php code in the product_info.php.html file

 

i need this output

 

<?php echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; ?>

 

but when i put it in the file nothing comes up at all the code doesnt even show

 

any ideas?

Edited by chrisstylez

Share this post


Link to post
Share on other sites

i even tried adding this

 

  $template['addwish'] = tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist'));  

 

to the sts_product_info.php file but that doesnt seem to work, is there anyone at all that can help ?

Share this post


Link to post
Share on other sites

Hi All,

 

Has anyone had any problems with using SSL and STS? I don't seem to have problems configuring for SSL on the sites that don't use sts.

 

My main problem is that once I've set up SSL the images and stylesheet don't display on the pages protected by SSL although I've checked the paths and confirmed them against other sites I've done with SSL.

 

Thought I'd ask. Thanks in advance.

 

AJ

Share this post


Link to post
Share on other sites
is it possible for me to add php code in the product_info.php.html file

 

i need this output

 

<?php echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; ?>

 

but when i put it in the file nothing comes up at all the code doesnt even show

 

any ideas?

I am also trying to add php scripts to the output with no success. can you use include statements of any kind? does everything have to be coded distinctly in each new template?

Share this post


Link to post
Share on other sites

Sorry Guys, posted this one before but got no reply.

 

Hi Guys,

 

I have just installed sts and I would like to know how I can incorporate this contrib

 

Login Box v5.4 in header

 

I have tried cutting and pasting the code into the header.php but nothing gets displayed.

 

Can anyone help me on this one?

 

Thanks in advance

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites

Hey all,

 

I'm having a problem in controlling the output of some text. Take a look at the category box and how due to the parentheses there are extra line breaks. I can't figure out how to make everything in the category box the same font.

 

http://www.ficfleet.com/afstore/

 

Thats where I'm having the problem.

 

Thanks in advance.

Share this post


Link to post
Share on other sites
Hi All,

 

Has anyone had any problems with using SSL and STS?  I don't seem to have problems configuring for SSL on the sites that don't use sts.

 

My main problem is that once I've set up SSL the images and stylesheet don't display on the pages protected by SSL although I've checked the paths and confirmed them against other sites I've done with SSL.

 

Thought I'd ask.  Thanks in advance.

 

AJ

Make sure that all no url's referenced in your template pages start with HTTP:// (ie: http://me.com/catalog/images/blah.gif)

 

All URL's MUST be either started with a slash (ie: /catalog/images/blah.gif) or a a directory (blah.gif).

 

If you have ANYTHING on an HTTPS: (SSL) page that references an HTTP: address, IE won't display the lock icon. This includes Stylesheets and Javascript include files.

 

Cheers!

 

- 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://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites
is it possible for me to add php code in the product_info.php.html file

 

i need this output

 

<?php echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; ?>

 

but when i put it in the file nothing comes up at all the code doesnt even show

 

any ideas?

I am also trying to add php scripts to the output with no success. can you use include statements of any kind? does everything have to be coded distinctly in each new template?

*edit*

 

10) Can I put executable code in my STS Template files?

 

Answer: Depends on the type of code.

 

PHP: No.

Server-side Includes: No.

Client-side java script: Yes.

Client-side Flash, Yes.

Client-side Java: Yes.

 

You can not put any server-side executable code in STS Template files. STS Template files are treated as a simple text file by STS and no executable codes in it are processed by the STS engine.

 

Any PHP code in a template file will be sent to the browser un-executed in the HTML source code.

 

Client-side programming such as Javascript, Flash, Java, etc. will be passed on the the browser in the HTML output, and it the clients' browser is then responsible for running it (or not, depending on browser settings).

 

*edit*

 

If you want to include new features to your code, you will need to create new template variables in sts_display_output.php, sts_product_info.php or sts_user_code.php. You can then put your new template variables wherever you like in the template file(s).

 

Hope this helps!

 

- Brian

Edited by Johnson

Simple Template System (STS)

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

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

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

Share this post


Link to post
Share on other sites
Sorry Guys, posted this one before but got no reply.

 

Hi Guys,

 

I have just installed sts and I would like to know how I can incorporate this contrib

 

Login Box v5.4 in header

 

I have tried cutting and pasting the code into the header.php but nothing gets displayed.

 

Can anyone help me on this one?

 

Thanks in advance

 

Mark

Don't put the code in header.php.

 

You need to add it in sts_user_code.php and capture it's output as a template variable (there should be an example in the sts_user_code.php file).

 

Then use your new template variable you created in your template file where you want it to appear.

 

- 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://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites

I have added master products to my sts site and the tables have gone quite weird could someone look and see what is required, I am not an expert.

 

http://www.designedbyelwyn.co.uk/test gointo the master products and the table pushes me right column down.

 

and thoughts let me know plz desperate.

 

thx in advance


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites
@ Brian ( Diamond Sea)

 

Hi Brian,

 

The following line is shown in my browser after using the $urlcat_33_41 template:

 

http://localhost/catalog/index.php?cPath=33&osCsid=5b431942e3ccdd0238536f7c051c140b_41

 

( and of course a parse error)

 

What can I do  to fix it and to use this categorie link to get to such a deep categorie ?

 

thanks in advance

byps

HI,

 

would be very nice if I could get a short info on that.

 

thanks

Rolf

Share this post


Link to post
Share on other sites

Has anybody worked out how to get it using a different theme for each product category yet?

Share this post


Link to post
Share on other sites

Hey all,

 

I'm having a problem in controlling the output of some text. Take a look at the category box and how due to the parentheses there are extra line breaks. I can't figure out how to make everything in the category box the same font.

 

http://www.ficfleet.com/afstore/

 

Thats where I'm having the problem.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

I was getting the problem of only the default template loading for every page. I read that if you:

// $scriptname = getenv('SCRIPT_NAME');

this worked but also this worked:

$scriptname = getenv('PATH_INFO');

I kept the latter as it seemed better. The original code was pasing :

getenv(SCRIPTNAME)=[/cgi-bin/php434]

Is there an explanation of why this happens? Will it effect STS any? The server is using:

Server OS: Linux 2.4.20-pre3

Database: MySQL 3.23.49-log

HTTP Server: Apache/1.3.26 (Unix) FrontPage/5.0.2.2510

PHP Version: 4.3.4 (Zend: 1.3.0)

 

Either way hopefully this will help somebody else. <_<

Share this post


Link to post
Share on other sites

Oh yeah, I also had to create a php.ini file with register_globals = 1; in it, to my root directory to get osCommerce to work. ;)

Share this post


Link to post
Share on other sites

Hi everyone,

 

I need help getting started using STS w/OS Commerce. I think [i hope!] it's just a conceptual leap I need to make. I've been looking through these threads but apparently, the 100 IQ person I am, still don't entirely get it:

 

OK, here's where I am - I have the standard osC code w/STS installed and working:

http://www.digitrax.biz/catalog

 

I have an overall home page design I'm generally happy with: http://www.digitrax.biz

 

I have a sample product Info page http://www.digitrax.biz/product_info.php

 

which is functionally equiv to a typical OS Commerce product info page such is at: http://www.digitrax.biz/catalog/product_in...?products_id=23

 

Finally, I've 'mocked up' a bunch of other page types that are equiv to the cart, account creation page, login page, etc:

 

http://www.digitrax.biz/mylayout.php

 

http://www.digitrax.biz/create_account.php

 

http://www.digitrax.biz/login.php

 

Here's my question: I simply don't understand how to connect the world of my pages on the root level directory to the osC/STS code. I see the sts_template.html file in /catalog/includes, but it just looks like it's listing the variables used on the front page. I don't get it.

 

As an example, how would I 'wire' my current product_info page? Create some kind of template for it and put it in /catalog/includes directory? Yes? and if this is so, do I go through a similar process and create a template for each of the page types osCommerce has?

 

Sorry to be so dense right now. Brian's appears to have done a fabulous job - I just need to take advantage of it!

 

Tom Hebert

Share this post


Link to post
Share on other sites

Hi

 

I cant get STS to display footer images on the infoboxes.

 

If I add the code to each of the box files like so:

 

<TR>

<TD>

<IMG SRC="images/infobox/Categories.gif" WIDTH=100% HEIGHT=13></TD>

</TR>

</td>

</tr>

 

Then the image only displays if I turn off the template.

 

Has anyone any ideas how to fix this or is there another way of doing this?

 

Any help very much appreciated.

 

Ian

Share this post


Link to post
Share on other sites

thebert you are on the right track with making individual pages for each PHP script. So for product_info.php you would make a template called product_info.php.html and put it into your template directory. The variables that you saw are the key to STS, as you can use them to put osCommerce info anywhere on a page. So by using $myaccount you can put the My Account information where ever you desire on your template pages.

Share this post


Link to post
Share on other sites

Hi

 

Could someone plz help me, I am tryin to get sts working with master products, and I am not having much luck I am affraid, everything works fine until I click on the product info then all goes off centre.

 

The link is here for the test products:

http://www.supaosc.com/1/customers/catalog/product_info.php

 

Any pointer much appreciated thx in advance.


Always seeking & Desperate to find a solution!

Share this post


Link to post
Share on other sites

Is there a way to use unique templates for each manufacturer? I know I can do that with categories but I have not managed getting manufacturers working.. (I want a pictures and some text for each manufacturer above the products)

Share this post


Link to post
Share on other sites
Hi

 

Could someone plz help me, I am tryin to get sts working with master products, and I am not having much luck I am affraid, everything works fine until I click on the product info then all goes off centre.

 

The link is here for the test products:

http://www.supaosc.com/1/customers/catalog/product_info.php

 

Any pointer much appreciated thx in advance.

Your problem seems to be that STS is assuming that where your </form> tag is, that is the end of your content section.

 

However, in your HTML (which you can view by adding &sts_debug=1 to your URL) your </form> tag is in the middle of your table, so STS chops everything off there.

 

Try moving the </form> tag in your product_info.php file down to just past your last </table> tag and that should fix it.

 

It should change from this (look for the BOLD text):

 

                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>

                <td class="main" align="right"><input type="hidden" name="products_id" value="34"><input type="image" src="includes/languages/english/images/buttons/button_in_cart.gif" border="0" alt="Add to Cart" title=" Add to Cart "></td></form>

                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>

              </tr>

            </table></td>

          </tr>

        </table></td>

      </tr>

      <tr>

        <td>

        </td>

      </tr>

    </table></td>

<!-- Master Products EOF //-->

<!-- body_text_eof //-->

    <td width="155" valign="top"><table border="0" width="155" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

 

to something like this:

 

                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>

                <td class="main" align="right"><input type="hidden" name="products_id" value="34"><input type="image" src="includes/languages/english/images/buttons/button_in_cart.gif" border="0" alt="Add to Cart" title=" Add to Cart "></td>

                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>

              </tr>

            </table></td>

          </tr>

        </table></td>

      </tr>

      <tr>

        <td>

        </td>

      </tr>

    </table></form></td>

<!-- Master Products EOF //-->

<!-- body_text_eof //-->

    <td width="155" valign="top"><table border="0" width="155" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

 

This may not be the exact place to move the </form> tag, but it should at least get you pointed in the right direction.

 

FYI, I was looking at this page http://www.supaosc.com/1/customers/catalog...749&sts_debug=1 to debug this. Look at what your code generates for the content section by looking at the debugging code for $sts_block['columnleft2columnright'] and compare that to what STS uses as the $content variable by looking at the debugging code for $template['content'].

 

Good luck!

 

- 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://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites
Is there a way to use unique templates for each manufacturer? I know I can do that with categories but I have not managed getting manufacturers working.. (I want a pictures and some text for each manufacturer above the products)

Not yet. It's on my list of things to do but I'm not done the next version yet.

 

Also, there is a known bug with displaying the manufacturers, as STS will attempt to use your index.php.html template when displaying them. This should be fixed in the next release as well.

 

Sorry, no ETA. Just whenever I get the chance to work on it...

 

- 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://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×