Jump to content



Photo
* * * * * 9 votes

[contribution] Simple Template System (sts)


  • Please log in to reply
5820 replies to this topic

#3461   bkellum

bkellum
  • Members
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 11 March 2007 - 03:09

I had one more question:

When I had first started using STS someone told me I needed to create a tpl file for every page. I thought that defeated the point of STS thinking I only needed 1 file for the entire site. I basically want all the pages to have the same exact layout, the only difference being the product pages, which i would like to keep the tell a friend feature on. do i need a tpl file for every page? can someone please explain this to me?

and does sts have a newsletter feature that can go in like the tell a friend feature?

STS can use one template for every page in your shop or you can create a template specific to individual pages in your shop. Its up to you.
If you only want one template, you would set it as the default template and it will be used for every page that does not have a custom template.

When it comes to your product pages:

Create One Template for All Products within a Specific Category:



You can have a template for all of your products inside a specific category by adding the category ID to the template name. For example:


Let say you have a category 22 inside category 11, and want all products in category 22 to use the same content template. You have to create a template and name it “product_info.php_c11_22.html” and place it inside the “content” folder (like catalog/includes/sts_templates/full/content/).



Create a Content Template to be used for All Products:


As in the example above, you can create a content template named “product_info.php_c11.html” that would be used for all products inside category 11 INCLUDING sub-categories (unless subcategories have their own template).

Now, as you probably already know, content templates are only for the center of the page. If you want to have a different header/columns/footer for products in a category 22, you have to create a template named “product_info.php_c11_22.html” and place it your template folder (not in the content folder), for example: catalog/includes/sts_templates/full/.

For more detailed information, see chapter 3, sections 6-10 of the STS documentation.


So, as the manual mentions, STS is quite versatile allowing you to keep it "simple" or very complex.
Bill Kellum

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

#3462   R.E.D

R.E.D
  • Members
  • 9 posts
  • Real Name:Johan Sjöholm

Posted 11 March 2007 - 09:52

I have tried createing:

articles_info_44.php aswell as articles-a-44.php.html
but i am NOT able to get a working STS page for each Article created using latest Article Manager /crying.gif' class='bbc_emoticon' alt=':'(' />

Is it not suppose to be as easy as making a STS template for each products!? /blink.gif' class='bbc_emoticon' alt=':blink:' />


Just like using different STS templates for different , specific products
i wonder how i can use different templates for different Articles created using Article manager.

i have an sts template named articles_info.php.html and that seem to work fine BUT if i try creating
a sts templates for articles-a-44.php = articles_info.php_44.html etc but that does not work /blink.gif' class='bbc_emoticon' alt=':blink:' />
...how shoudl i do!? Thanks !!



#3463   jgarite

jgarite
  • Members
  • 152 posts
  • Real Name:Joe Garite II
  • Gender:Male
  • Location:Owego, NY, USA

Posted 11 March 2007 - 22:52

thanks bkellum, i understand now.

I am am trying to make some links in the index English file. i am using
<a href="products_new.php">
but i realize that it doesnt hold the user SID so when they go to the link, they lose there cart. how can i fix this? i tried to use something like
<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, '') . '">
, but it didnt work. any ideas?

#3464   jgarite

jgarite
  • Members
  • 152 posts
  • Real Name:Joe Garite II
  • Gender:Male
  • Location:Owego, NY, USA

Posted 12 March 2007 - 01:26

Also, I am recieving this extra coding at the top of my html before the real html starts:
<!-- right_navigation_eof //-->
	</table></td>
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<!-- footer_eof //-->
<br>
</body>
</html>

Any ideas where thats coming from and how to get rid of it?

#3465   bkellum

bkellum
  • Members
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 12 March 2007 - 03:30

thanks bkellum, i understand now.

I am am trying to make some links in the index English file. i am using

<a href="products_new.php">
but i realize that it doesnt hold the user SID so when they go to the link, they lose there cart. how can i fix this? i tried to use something like
<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, '') . '">
, but it didnt work. any ideas?

Making a simple text link that does not lose the session ID.

If you want to just make a regular text link, you would use the tep_href_link function like all of the other links on the page, and title it whatever you want... For example, using your products_new.php from above, you can do it in one of the following examples:

<a href="<?php echo tep_href_link(FILENAME_PRODUCTS_NEW); ?>">Click here to see our new products</a>

Orrrrr...

<a href="<?php echo tep_href_link('products_new.php'); ?>">Click here to see our new products</a>

Edited by bkellum, 12 March 2007 - 03:32.

Bill Kellum

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

#3466   bkellum

bkellum
  • Members
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 12 March 2007 - 03:37

I have tried createing:

articles_info_44.php aswell as articles-a-44.php.html
but i am NOT able to get a working STS page for each Article created using latest Article Manager /crying.gif' class='bbc_emoticon' alt=':'(' />

Is it not suppose to be as easy as making a STS template for each products!? /blink.gif' class='bbc_emoticon' alt=':blink:' />

Try asking this in the articles manager forum. I'm not familiar with this contribution. If it is creating a custom infobox that includes your links, then you will need to add this in your sts_user_code.php file to create a STS tag that you can use in your template. For ex: $articles
If this contribution creates new PHP pages, then you should be able to create templates for it just like any other PHP page in osCommerce. For ex: If the actual PHP page is articles_info.php, then the template would be articles_info.php.html and would be saved in your sts_templates/my_templates/ folder where "my_templates" is the same template folder that you have set in the STS Default module.
Bill Kellum

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

#3467   Shanke

Shanke
  • Members
  • 38 posts
  • Real Name:Shane Adair

Posted 12 March 2007 - 14:34

Has anyone managed to get the Additional Images contrib working on a content page for sts4.4? It works fine for the regular product_info.php.html but I can seem to get it setup on a content page.

Cheers
Shane

#3468   jgarite

jgarite
  • Members
  • 152 posts
  • Real Name:Joe Garite II
  • Gender:Male
  • Location:Owego, NY, USA

Posted 12 March 2007 - 17:54

Making a simple text link that does not lose the session ID.

If you want to just make a regular text link, you would use the tep_href_link function like all of the other links on the page, and title it whatever you want... For example, using your products_new.php from above, you can do it in one of the following examples:

<a href="<?php echo tep_href_link(FILENAME_PRODUCTS_NEW); ?>">Click here to see our new products</a>

Orrrrr...

<a href="<?php echo tep_href_link('products_new.php'); ?>">Click here to see our new products</a>

Thanks bkellum, I'll try that tonight. /rolleyes.gif' class='bbc_emoticon' alt=':rolleyes:' />

#3469   rigadin2

rigadin2
  • Members
  • 349 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Helsinki/St-Petersburg

Posted 16 March 2007 - 07:16

I have tried createing:

articles_info_44.php aswell as articles-a-44.php.html
but i am NOT able to get a working STS page for each Article created using latest Article Manager /crying.gif' class='bbc_emoticon' alt=':'(' />

Is it not suppose to be as easy as making a STS template for each products!? /blink.gif' class='bbc_emoticon' alt=':blink:' />


As you probably know, you have to enable the product info module in admin in order to get the product info templates to work. It means that a module is needed as soon as you want some "extra" features to detect what template to use.

The default module can handle templates according to script name, like articles_info.php.html, but has no clue about the article ID, category ID, product ID, whatever ID. It's just impossible to know all possible things.

So, if you want something special for articles_info.php, you need a module named includes/modules/sts/sts_articles_info.php that will detect what is the article ID to be displayed, and choose the right template for it. The best way is to start from sts_product_info.php, but forget (for now) the detection of a content template. That would be the next step.

- Rigadin2
STS v4.5 SP5 is out, and check the STS Power Pack contribution too!
New thumbnailer using phpThumb: oscThumb. Works great.

#3470   lowpoint

lowpoint
  • Members
  • 3 posts
  • Real Name:Adrian

Posted 17 March 2007 - 07:08

Hi everyone,

Another n00b around, I have a problem (duh). I have installed a fresh copy of the latest oscommerce, then I installed STS (all working), then I activated it from the admin menu.

Now comes the problem, when I'm adding different tags to a new template, I only get text (ex: $date).

Can you please tell me what I'm missing?


Thank you,
-Adrian

#3471   bkellum

bkellum
  • Members
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 17 March 2007 - 07:11

Hi everyone,

Another n00b around, I have a problem (duh). I have installed a fresh copy of the latest oscommerce, then I installed STS (all working), then I activated it from the admin menu.

Now comes the problem, when I'm adding different tags to a new template, I only get text (ex: $date).

Can you please tell me what I'm missing?


Thank you,
-Adrian

Make sure your new template has the required code in order to make the tags work. You can find an example of this in the test/blank_sts_template.html file provided with the contribution.
Also: If you are using end characters, you will have to add those to your tags. For ex: $date will be $date# or whatever you used as your end character.
Bill Kellum

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

#3472   sacaccess

sacaccess
  • Members
  • 9 posts
  • Real Name:Demetre

Posted 17 March 2007 - 11:16

I know that STS dose not control the way boxes look how ever i need a hand pointing me in the right direction please.... I want to change the display of the boxes seems theres a empty table above the content in each box and it makes for a large gap in my design... if you want to see what i mean check out the site..

www.lendonline.net I would like to kill the gaps in there.. its pretty apparent on the left hand menu... i have not been using OSC for more than a week or two and this is my first php script i have been working with so bare with me please. lol /whistling.gif' class='bbc_emoticon' alt=':-"' />

Edited by sacaccess, 17 March 2007 - 11:18.


#3473   bkellum

bkellum
  • Members
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 17 March 2007 - 14:33

I know that STS dose not control the way boxes look how ever i need a hand pointing me in the right direction please.... I want to change the display of the boxes seems theres a empty table above the content in each box and it makes for a large gap in my design... if you want to see what i mean check out the site..

www.lendonline.net I would like to kill the gaps in there.. its pretty apparent on the left hand menu... i have not been using OSC for more than a week or two and this is my first php script i have been working with so bare with me please. lol [img]http://forums.oscommerce.com/style_emoticons/default/whistling.gif[/img]

Demetre, Actually, STSv4.4 does control the way boxes look if you enable the "Use Infobox Templates" in the STS Default Module.
Bill Kellum

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

#3474   jasper77

jasper77
  • Members
  • 10 posts
  • Real Name:Jessica Balew

Posted 18 March 2007 - 23:39

Hi there, I was looking at the file (product_info.php_26.html) and wondering how this is going to work if I want to use a module for extra images, because I want to have a minimum 4 images per product.



Many thanks!

#3475   averagejane

averagejane
  • Members
  • 21 posts
  • Real Name:Average Jane

Posted 19 March 2007 - 14:22

Bill, this is a GREAT contrib. If you have a link for a donation (via PayPal), please do send it over to me.

I have a few questions - I spent some time searching the forums, but had trouble finding what I am looking for.

I have a couple of questions:

#1 - Checkout Pages


Is there a list of "tokens" for use with Checkout Pages? From what I'm reading, in order to change the look/feel/display of the checkout pages, I need to make individual pages in STS for each corresponding checkout page.

If that assumption is correct - then are there any placeholders already set up for the checkout pages?


#2 - Category Listings


What I'd like to do, on my homepage, is to have my categories show up as category image, with name below it - in a 3-column layout. I'd like for this to be dynamic, as there will be categories added and removed.

Can you give any direction on how this would be done? I already have the index.html.php page - I'm just missing how to set up the layout of the category list (no subcategories) with image and text link (below image) in columns.

Any assistance or direction you could give would be great.

Thanks
Jane

#3476   wotsupdoc

wotsupdoc
  • Members
  • 72 posts
  • Real Name:Robert

Posted 19 March 2007 - 16:28

STS version 4.4/OSC version 2.2

Still struggling to get everything working......

Problem: background doesn't show in STS Status: Solved
Problem: "Template file does not exist" when I enable STS. Status: Solved
Problem: "Warning: move_uploaded_file(): open_basedir restriction in effect" when I upload pictures. Status: Solved
Problem: pictures of products look squashed Status: Solved

Now I have to take the next hurdle...
When I click on a product in the shop, I see the "Click to Enlarge" link.
Before I click, I see no errors in IE6.
Then I click, I see the error sign and nothing happens. Error msg: object is expected.
Then I copy the link and trim off the javascript stuff, paste it back into the address bar in IE6, then everything works fine.
I have no popup blockers or anything

Firefox tells me "popupWindow is not defined"

I have searched the forum and somebody suggested that I put <!--$headcontent--> in the header in the page, but it was already there, in all the pages

Does anyone have suggestions for me?

#3477   gmltw

gmltw
  • Members
  • 61 posts
  • Real Name:Gary
  • Gender:Male
  • Location:US - Texas

Posted 19 March 2007 - 22:42

OK, I almost have my site looking close to what I want it to look like and I have noticed a few problems. Hoping someone can point me in the right direction.

1. When using STS I am not seeing the correct titles in my browser's tabs ( firefox for instance).

For instance, when STS is off and I go to view a product, my titles are auto generated. So for this product "Decaffeinated Chocolate Hazelnut Ground" it will display this in the browser tab bar: "Decaffeinated Chocolate Hazelnut Ground by: Shalina - Gourmet Soiree -"

With STS off it displays Gourmet Soiree no matter what page I am viewing. No dynamic titles?

Q. Do I need go back and make all of the same changes that I have made for other contributions in some special STS pages or something. Why is STS not showing the titles correctly? Where does it pull the information for Products, Categories, etc. if not from Product_info.php, Index.php, etc. ?

2. I am pretty sure this is associated with the first one. I have installed other contribs, category_descriptions_v502, additional_infov1.2, Manufacturers_Popup_2.5, to name a few. These show up in the default store when STS is set to false.

When STS is set to true they are nowhere to be found.

Q. Where can I edit what information gets passed to the $content tag if it is not using the product_info.php in catalog/ ?

3. Q. How can you include content where you want it without using an info box. The example in sts_user_code.php is for an info box and I am not sure how to not include something without it being in an info box.

I really love the way you can control each and every page of your site with out going through a lot of hard coding. For instance - I have set it up so that when someone views a product, our logo that is found on our home page and the category pages, is removed and replaced with a smaller text name. This way the product that they are wanting to look at is right at the top of the page. This is awesome. I just need to figure out how to do the above few things and I think all will be good.

If there are answers to these questions already, I would be very happy for someone to just leave a link to the solution. I have searched and searched and have not found what I am looking for. I am sure I am just not searching for the right combination of keywords but I have run out of ideas.

Thanks,

Gary

#3478   bkellum

bkellum
  • Members
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 20 March 2007 - 00:29

1. When using STS I am not seeing the correct titles in my browser's tabs ( firefox for instance).

For instance, when STS is off and I go to view a product, my titles are auto generated. So for this product "Decaffeinated Chocolate Hazelnut Ground" it will display this in the browser tab bar: "Decaffeinated Chocolate Hazelnut Ground by: Shalina - Gourmet Soiree -"

With STS off it displays Gourmet Soiree no matter what page I am viewing. No dynamic titles?

Q. Do I need go back and make all of the same changes that I have made for other contributions in some special STS pages or something. Why is STS not showing the titles correctly? Where does it pull the information for Products, Categories, etc. if not from Product_info.php, Index.php, etc. ?

Thanks,

Gary

Hi Gary,
First things first...
Do you have the following in your templates?
<html $htmlparams>
<head>
<meta http-equiv="Content-Language" content="en-us">
<!--$headcontent-->
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

NOTE: Do not put <title>...</title> tags in your header in your template page. It will be added
as part of the $headcontent variable that is picked up from the PHP script that you are templating.

Check the above first for your first question and then let us know the results.
Hope this helped,
Bill Kellum

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

#3479   bkellum

bkellum
  • Members
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 20 March 2007 - 01:02

2. I am pretty sure this is associated with the first one. I have installed other contribs, category_descriptions_v502, additional_infov1.2, Manufacturers_Popup_2.5, to name a few. These show up in the default store when STS is set to false.

When STS is set to true they are nowhere to be found.

Q. Where can I edit what information gets passed to the $content tag if it is not using the product_info.php in catalog/ ?
Thanks,

Gary

Manufacturers_Popup_2.5 needs a STS tag created much like the ones in sts_column_left.php since the contribution uses an infobox to display its information. If you do not create this tag, it will not show when STS is turned on.
Bill Kellum

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

#3480   bkellum

bkellum
  • Members
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 20 March 2007 - 01:10

Hi there, I was looking at the file (product_info.php_26.html) and wondering how this is going to work if I want to use a module for extra images, because I want to have a minimum 4 images per product.



Many thanks!

Jessica, check the STS4 Power Pack site. It has the instructions listed for one of the image contributions in use with STS on the product page. Link is in my signature.
Bill Kellum

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