Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

I'm very very very sorry for being the world's worst noob, but I can't actually seem to find a link to download the package? Am I a huge idiot, or is there something I should know?

Share this post


Link to post
Share on other sites
Andrew - you are correct that osCommerce uses "table" bloat when it should not do. So to strip it out of the base osCommerce files makes perfect sense and has little to do with whether or not STS is used.

 

burt, No, without STS installed, the tablebox function is suitable to be used, it takes the headertext and adds the corner images (doing some checks for which corner image file should be used).

 

However, after you install STS, STS still uses the OSC tablebox function before then passing it to the template, pointless, as it does not add the corner images (that's left to the template) so you just get the headertext wrapped in a table before passed to the STS template.

Share this post


Link to post
Share on other sites

I'm really struggling to use Optional Related Products with STS, despite following the advice in its forum on the subject.

 

Creating my own placeholder by:

 

$sts->start_capture();

require(DIR_WS_MODULES . FILENAME_RELATED_PRODUCTS);

$sts->stop_capture('related_products', 'box');

 

in "sts_user_code.php"

 

and inserting

 

$related_products$ into "product_info.php.html"

 

The text "$related_products$" is displayed on the page!

 

The REQUIRE statement above works fine in standard product_info.php

 

Any advice gratefully received.

Share this post


Link to post
Share on other sites

$templatedir does not seem to work fully, at the moment I have the following templates:

sts_template.html

infobox.php.html

infobox_header.php.html

infobox_categories_header.php.html

infobox_new_products_header.php.html

infobox_shopping_cart_header.php.html

 

Essentially, the main ones are

sts_template.html

infobox.php.html

infobox_header.php.html

 

I have the following to adjust the corner images (much like the original OSC)

infobox_categories_header.php.html

infobox_new_products_header.php.html

infobox_shopping_cart_header.php.html

 

I'm trying to use $templatedir instead of includes/sts_templates/template1 for SRC of images, however it appears to only work some of the time.

 

On the index page:

 

infobox_categories_header.php.html (should be using infobox_categories_header.php.html) - Works fine

Manufacturers (should be using infobox_header.php.html) - Works fine

Quick Find (should be using infobox_header.php.html) - Does NOT work

Information (should be using infobox_header.php.html) - Works fine

New Products for Month (should be using infobox_new_products_header.php.html) - Does NOT work

Shoppnig Cart (should be using infobox_shopping_cart_header.php.html) - Does NOT work

Best Sellers (should be using infobox_header.php.html) - Works fine

 

Instead of it replacing $templatedir with includes/sts_templates/templatename I see

http://www.site.com/catalog/$templatedir/images/infobox/corner_left.gif

when it should be

http://www.site.com/catalog/includes/sts_templates/templatename/images/infobox/corner_left.gif

 

I'm also using $templatedir to point to the stylesheet, instead of the one at the catalog root, in the template and that works fine.

 

Anyone else experienced this? I'd rather use $templatedir so it's easier to make lots of templates quickly.

Edited by AJStevens

Share this post


Link to post
Share on other sites

So I have installed 4.5.8 on my new installation of OSC 2.2 RC2. I have activated the template in the admin panel and that is working.

 

I can't seem to get the template to use the STS tags. Even the test templates don't show any data, just the tags. I'm sure I'm missing something silly. Any idea what it could be?

 

My goal is simple: use my custom template to sell a single product through OSC. I just need an "Add to Cart" button on this custom product page, and then I need to customize the checkout templates. Any advice for this? I think I'm going in the right direction using STS, but I don't see a tag for "Add to Cart".

 

Any help is appreciated!

Share this post


Link to post
Share on other sites

OK so I can't edit my previous post, but I have an update. Some tags work, such as $content, but others don't, such as $startforum and $endform.

 

As I said in my first post, all I'm really trying to do here is add the "Add to Cart" function to my custom template. Then I can move on to customizing the checkout templates. Is there an "Add to Cart" tag? What else do I need to add to my template? (I've added the $headcontent tag and $htmlparams)

 

Thanks!

Share this post


Link to post
Share on other sites
$templatedir does not seem to work fully, at the moment I have the following templates:

 

I'm also using $templatedir to point to the stylesheet, instead of the one at the catalog root, in the template and that works fine.

 

Anyone else experienced this? I'd rather use $templatedir so it's easier to make lots of templates quickly.

No problems here. Do you have your infobox templates located in the boxes folder of your template directory? Using $templatedir is quite common and the preferred method verses static URLs.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
I'm very very very sorry for being the world's worst noob, but I can't actually seem to find a link to download the package? Am I a huge idiot, or is there something I should know?

 

Adam,

Click on the STSv4.5.8 link in my signature below. Then, on the download page, click on the downward arrow graphic to the right of each download to initiate the download process.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
I'm really struggling to use Optional Related Products with STS, despite following the advice in its forum on the subject.

 

Creating my own placeholder by:

 

$sts->start_capture();

require(DIR_WS_MODULES . FILENAME_RELATED_PRODUCTS);

$sts->stop_capture('related_products', 'box');

 

in "sts_user_code.php"

 

and inserting

 

$related_products$ into "product_info.php.html"

 

The text "$related_products$" is displayed on the page!

 

The REQUIRE statement above works fine in standard product_info.php

 

Any advice gratefully received.

 

Alan,

If you have not defined a stop character ($) at the begining of your template, then STS does not know what to do with a tag that has one ($related_products$). Remove the last $ from your tag.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
burt, No, without STS installed, the tablebox function is suitable to be used, it takes the headertext and adds the corner images (doing some checks for which corner image file should be used).

 

However, after you install STS, STS still uses the OSC tablebox function before then passing it to the template, pointless, as it does not add the corner images (that's left to the template) so you just get the headertext wrapped in a table before passed to the STS template.

Andrew, STS works perfectly the way it is. It is also OK to dive into the PHP code and do what you proposed but that would not be good for everyone especially if they do not use the infobox template feature of STS. The headertext is not the only function that is wrapped inside a table and that is because osCommerce is based on tables. When version 3 comes out, it will be based on CSS and should be a lot easier to customize without being limited or restricted to tables.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
SEARCHBOX:

 

I have this piece of code in my sts_template for a searchbox:

 

 

 

When I search for a product, it will be found but on top of the page the following error message comes up:

 

 

 

Any idea what is wrong here ?

 

When i put $searchbox into the template it is working fine but not with the above piece of code...

Here is my form:

<form name="advanced_search" action="advanced_search_result.php" method="get">
	<td bgcolor="#bcbcbc">
<table width="100%" cellpadding="0" cellspacing="0"><tr><td class="navigation">Search </td>
<td align="center"><input type="hidden" name="search_in_description" value="1"><input type="hidden" name="inc_subcat" value="1" 1><input type="text" name="keywords" size="10" maxlength="30" class="searchForm" style="width: 95px"></td><td align="center"> <input type="image" src="$templatedir/images/go.gif" border="0" alt="Search" title=" Search "></td></tr></table>
	</td></form>


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
OK so I can't edit my previous post, but I have an update. Some tags work, such as $content, but others don't, such as $startforum and $endform.

 

As I said in my first post, all I'm really trying to do here is add the "Add to Cart" function to my custom template. Then I can move on to customizing the checkout templates. Is there an "Add to Cart" tag? What else do I need to add to my template? (I've added the $headcontent tag and $htmlparams)

 

Thanks!

You mentioned tags that were meant for the product_info.php.html content templates. Do you have the Product Info STS Module enabled in the Admin?


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
Alan,

If you have not defined a stop character ($) at the begining of your template, then STS does not know what to do with a tag that has one ($related_products$). Remove the last $ from your tag.

 

Bill

 

Thanks for the quick response. More info: I HAD defined the stop char, but had put the placeholder in sts_templates\test\content\product_info.php.html

 

Have just put it after $content in sts_templates\test\product_info.php.html

 

and it works!

 

I am happy about that, but VERY confused.

 

Alan

Share this post


Link to post
Share on other sites

Hi

 

I have the 4.5.8 sts and the googlecode 1.1 installed on my osc install

My site that i've done a for client has one major issue and that is the catalog_login.php.html. I coped the shoppingcart.html from full template and renamed to catalog_login.html

 

the problem i'm having is say the site is 700pixels wide and the $contents is set to 540pixels - i'm seeing the "I am a returning customer." table hit 904 pixels I'm not sure why :'( :'( :'(

 

 

code used for catalog_login.php (changed 540 to 340 in this code)

 

<table border="0" cellpadding="0" cellspacing="1" width="340" class="infoBox">
 <tr>
<td width="340"><table border="0" cellpadding="0" cellspacing="0" width="340" class="infoBoxContents">
  <tr>
	<td width="340">$content</td>
  </tr>
</table></td>
 </tr>
</table>

 

Google checkout.

 

I've install the above add on too, and when i disable sts the google checkout is showing ok but with sts on it isn't ? why ?

Any help would be appricated... I've managed to configure the rest of the site using sts first with osc too...

 

Anyhow thanks everyone in advance (before I pull my hair out).

Share this post


Link to post
Share on other sites
You mentioned tags that were meant for the product_info.php.html content templates. Do you have the Product Info STS Module enabled in the Admin?

 

I have it enabled now with default settings. Do I need to enable the "Default" or "Index" STS modules? What do I point to my custom html template?

Share this post


Link to post
Share on other sites

I am trying to get STS to work with LinksManager II( actually vice versa), ANyone have this addon working that can help?

Edited by digilexic

Share this post


Link to post
Share on other sites

Hey,

 

Is there a way to include the contents of a file that contains HTML so that it will be evaluated by the STS token parser? In other words, I have a fairly large number of STS templates, but each has the same code for the first 35 lines. I would like to extract that code from the many templates into a separate file and have it placed there by some form of include. Those 35 lines contain several STS tokens that will need to be substituted.

 

One solution is to make a token in the "sts_user_code.php" file, swapping out all the vars before the substitution. But I didn't want to do that because one of the goals of the project is to allow the client to open the templates in Dreamweaver (or whatever) and have a somewhat reasonable page to work with.

 

Second question: Towards the deadline of this project, I'm scrambling to get a bunch of the not-very-often-viewed files working. I ended up copying the same generic template that has a large, "overflow:auto;" area. Since all of these files are EXACTLY the same, I was hoping there's a better way to do this than a bunch of duplicates. Something like the fallthrough when looking for a specific product page but instead of "product_info.php_c11.html" being the fallthough for "product_info.php_c11_22.html", "checkout.php.html" would be the fallthrough for:

checkout_confirmation.php.html

checkout_success.php.html

checkout_payment.php.html

checkout_shipping.php.html

 

And "create.php.html" would be the fallthrough for:

create_account_success.php.html

create_account.php.html

 

I use sts_template.html and index.php.html for other things. (maybe that's a solution... but would I be trading off six for half a dozen?)

 

Thanks again for the amazing STS.

Share this post


Link to post
Share on other sites
Hi

 

I have the 4.5.8 sts and the googlecode 1.1 installed on my osc install

My site that i've done a for client has one major issue and that is the catalog_login.php.html. I coped the shoppingcart.html from full template and renamed to catalog_login.html

 

the problem i'm having is say the site is 700pixels wide and the $contents is set to 540pixels - i'm seeing the "I am a returning customer." table hit 904 pixels I'm not sure why :'( :'( :'(

 

 

code used for catalog_login.php (changed 540 to 340 in this code)

 

<table border="0" cellpadding="0" cellspacing="1" width="340" class="infoBox">
 <tr>
<td width="340"><table border="0" cellpadding="0" cellspacing="0" width="340" class="infoBoxContents">
  <tr>
	<td width="340">$content</td>
  </tr>
</table></td>
 </tr>
</table>

 

Google checkout.

 

I've install the above add on too, and when i disable sts the google checkout is showing ok but with sts on it isn't ? why ?

Any help would be appricated... I've managed to configure the rest of the site using sts first with osc too...

 

Anyhow thanks everyone in advance (before I pull my hair out).

I'm assuming that the name "catalog_login.html" is a typo as all STS templates besides the default template should be named as so: scriptname.php.html. Since the stock osC does not have a "catalog_login.php" file I must assume that this is a custom page.

 

Regarding the google checkout contribution: What isn't showing? If it is a custom box, then you need to create a new infobox tag for it in sts_user_code.php. Instructions for creating the tag is listed in the file.

 

Hope this helped,

Edited by bkellum

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
I have it enabled now with default settings. Do I need to enable the "Default" or "Index" STS modules? What do I point to my custom html template?

Please read the separate documents (included in the docs folder of the contribution) for each module and that will show you how to set the settings.

 

Important: DO NOT ADD YOUR CUSTOM TEMPLATE NAME INTO THE MODULE ITSELF. STS functions by using the name of each template to call up specific scripts. The only template name listed should be the "default" template which out of the box is "sts_template.html".


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
Please read the separate documents (included in the docs folder of the contribution) for each module and that will show you how to set the settings.

 

Important: DO NOT ADD YOUR CUSTOM TEMPLATE NAME INTO THE MODULE ITSELF. STS functions by using the name of each template to call up specific scripts. The only template name listed should be the "default" template which out of the box is "sts_template.html".

 

OK Bill - I read through the docs more thoroughly and I have made some progress. I have my sts_blank_template.html customized and enabled in the /test folder. That works. I have enabled the product info module with its default settings but cannot seem to get the product info "content" area to change. I have created a /content folder under /test and have saved a file called "product_info.php_28.html" under it, which is using the product number of the item I'm trying to customize. When I edit that file the content area remains the same. I think I'm missing something here. What should I be editing to change the content area of my product pages? Thanks for your help, Bill!

Share this post


Link to post
Share on other sites
OK Bill - I read through the docs more thoroughly and I have made some progress. I have my sts_blank_template.html customized and enabled in the /test folder. That works. I have enabled the product info module with its default settings but cannot seem to get the product info "content" area to change. I have created a /content folder under /test and have saved a file called "product_info.php_28.html" under it, which is using the product number of the item I'm trying to customize. When I edit that file the content area remains the same. I think I'm missing something here. What should I be editing to change the content area of my product pages? Thanks for your help, Bill!

SC, do you have a product ID 28?

 

Try this,

Enable all of the STS modules (Default, Index, Product_info, and Popup Image).

Test again.

 

Also, if you are going to use the advanced features of STS, I suggest that you either use the "full" template folder or create a new template folder with the following folders: boxes, content. Place all of your content templates in the sts_templates/full/content folder.

 

As a last resort, use the sample content template full/content/product_info.php_26.html and just change 26 to your product ID 28. Test again.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
SC, do you have a product ID 28?

 

Try this,

Enable all of the STS modules (Default, Index, Product_info, and Popup Image).

Test again.

 

Also, if you are going to use the advanced features of STS, I suggest that you either use the "full" template folder or create a new template folder with the following folders: boxes, content. Place all of your content templates in the sts_templates/full/content folder.

 

As a last resort, use the sample content template full/content/product_info.php_26.html and just change 26 to your product ID 28. Test again.

 

Did as you suggested (everything) and I still can't change the "content" output. My product path is "catalog/product_info.php/products_id/28". I am using search-engine safe URLS - could that be an issue?

Share this post


Link to post
Share on other sites
Did as you suggested (everything) and I still can't change the "content" output. My product path is "catalog/product_info.php/products_id/28". I am using search-engine safe URLS - could that be an issue?

BINGO! Never use Search Engine Friendly URLs as it does not work and gives unpredictable results.

 

This has nothing to do with STS as using that URL feature will cause a stock osC to be unstable.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
BINGO! Never use Search Engine Friendly URLs as it does not work and gives unpredictable results.

 

This has nothing to do with STS as using that URL feature will cause a stock osC to be unstable.

 

Yeah, I disabled it and all is well. I would suggest mentioning that in the .doc somewhere in the first few pages in bold! Thanks for all of your help Bill - now I can start the dirty work of customizing code :)

Share this post


Link to post
Share on other sites
Yeah, I disabled it and all is well. I would suggest mentioning that in the .doc somewhere in the first few pages in bold! Thanks for all of your help Bill - now I can start the dirty work of customizing code :)

Actually, it does. It states that it is still under development. I can see how it can be misleading though. :blink:

 

Glad you got it worked out,


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

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

×