Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

1) This is not STS that decides if the update button in the cart content page is SSL or not, it is the shopping_cart.php page itself! STS had a problem of a placeholder $cartcontents that was never using SSL, but this placeholder is only a text link and by using this link, the whole shopping_cart.php page would not be SSL.

 

2) You can make templates depending on language in several ways. The best way in my opinion is to use only one template for all languages, and place the texts in language files or database, like osCommerce do. Anyway, it is also possible to modify the modules in includes/modules/sts, as they decide which template to use. A third possibility is to put php code at beginning of the default template, to include the desired template based on language.


STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites
You can make templates depending on language in several ways. The best way in my opinion is to use only one template for all languages, and place the texts in language files or database, like osCommerce do. Anyway, it is also possible to modify the modules in includes/modules/sts, as they decide which template to use. A third possibility is to put php code at beginning of the default template, to include the desired template based on language.

 

Hello Rigadin2, thank you very much for your reply. I usually use flash headers in my sites, so I can't use the first option. I'm not sure how to do the changes you suggest for options 2 and 3, I think the easiest way would be to include php code at the beginiing of the default template but I don't know PHP, could you please tell me how to do this?

 

Thank you very much again!!!

Share this post


Link to post
Share on other sites
You can make templates depending on language in several ways. The best way in my opinion is to use only one template for all languages, and place the texts in language files or database, like osCommerce do. Anyway, it is also possible to modify the modules in includes/modules/sts, as they decide which template to use. A third possibility is to put php code at beginning of the default template, to include the desired template based on language.

 

Hello Rigadin2, thank you very much for your reply. I usually use flash headers in my sites, so I can't use the first option. I'm not sure how to do the changes you suggest for options 2 and 3, I think the easiest way would be to include php code at the beginiing of the default template but I don't know PHP, could you please tell me how to do this?

 

Thank you very much again!!!

Share this post


Link to post
Share on other sites
Hi, i'm trying to edit the style of the category infobox, as shown in the link below

 

http://www.macro-solutions.co.uk/templates/1/

 

Is there an easy way of doing this? Many thanks in advance

James, if you are using STSv4.5.2, then you can template the infobox as long as you have infobox templates set to "true" in the STS admin module. You will then need to use that in combonation with the stylesheet.css file.


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
James, if you are using STSv4.5.2, then you can template the infobox as long as you have infobox templates set to "true" in the STS admin module. You will then need to use that in combonation with the stylesheet.css file.

 

Bill, excuse my ignorance but what exactly would i call the infobox?

Share this post


Link to post
Share on other sites

Ok I need a little help and I am sure the answer is simple. I thought I was being smart and I went and edited the index.php.html is the full STS template and just deleted the oscommerce.gif,...well pretty much the entire header and then in dreamweaver, I inserted a flash banner and gave it the proper placement on the site. Problem is, the html shows the correct size of the banner, but I can not get the banner to cut on, what am I doing wrong here?? By the way I did add the flash banner contribution and can't seem to get that to help either. Any ideas?? And your responses are greatly appreciated.

Share this post


Link to post
Share on other sites
Bill, excuse my ignorance but what exactly would i call the infobox?

James, you can see the list of infoboxes in use by your shop in the following directory:

catalog\includes\boxes

 

To make a template for the category box, you would create a template in sts_templates/your_template_folder/boxes/infoboxes_categories.php.html

 

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

Share this post


Link to post
Share on other sites
Ok I need a little help and I am sure the answer is simple. I thought I was being smart and I went and edited the index.php.html is the full STS template and just deleted the oscommerce.gif,...well pretty much the entire header and then in dreamweaver, I inserted a flash banner and gave it the proper placement on the site. Problem is, the html shows the correct size of the banner, but I can not get the banner to cut on, what am I doing wrong here?? By the way I did add the flash banner contribution and can't seem to get that to help either. Any ideas?? And your responses are greatly appreciated.

Thomas, what HTML code are you using to try to get your Flash Banner to work? I'm assuming that your error is within the HTML code that you are using in your template to try to get the Flash Banner to work.

Post just the HTML that relates to the banner.


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
You can do it in catalog\includes\modules\sts\sts_default.php, at the beginning of function find_template. I know there is some text there saying that it's not the best way to do it, but it is the most simple. The only down side is that you'll have to do this modification each time you upgrade the module sts_default.php (but it's not so often).

 

The other solution is to create a module sts_product_print.php that handles this, but it's a bit more complex if you have never done it.

 

- Chris

 

I'm not sure how to do this. The content part remains empty in product_print.php

Has anyone used STS together with Printer Friendly Product Page?

Share this post


Link to post
Share on other sites

I am trying to use $bestsellersboxonly but the notification box still shows instead of bestsellers in the product information page. Doesn't $bestsellersboxonly works as it should?

Share this post


Link to post
Share on other sites

Hello, could somebody please help me: I need to know what code to add to my sts so that if someone choses to see the site in English they get one template and if they decide to see it in Spanish they get another template. Rigadin suggested I add some code but I don't know PHP so I would appreciate if someone can help me on this or tell me an easier way to use different templates for each language (my templates usually use flash headers and menus).

 

Or maybe if one of the latest sts versions already supports this?

Share this post


Link to post
Share on other sites

I just can't wade through 181 pages of this thread, but I'm sure it must have been asked before. Is it possible using STS to define custom content for the product_list.php page? Or has anyone added this enhancement. I want to be able to do something like the Add Multiple Products to Cart contribution, but be able to specify different content templates for different categories.

 

Can anyone help?

 

Thanks,

 

Allen

http://www.healthy-living-products.co.uk

Share this post


Link to post
Share on other sites

Thanks for the help Bill! I'm having a small problem at the moment trying to install a contribution which displays a login box on the home page similar to site below

 

http://www.prozis.com/

 

I'm using the contribution

 

http://www.oscommerce.com/community/contri...ons,2538/page,9

 

Everything is installed its just when i come to using the PHP code to include it in sts_template.html i get the following error

 

Code:

// BOF: WebMakers Added: Login Box My Account

require(DIR_WS_BOXES . 'loginbox.php');

// EOF: WebMakers Added: Login Box My Account

 

Error: Fatal error: Call to a member function on a non-object in /home/wwwmacr/public_html/templates/custom1/includes/functions/html_output.php on line 78

 

Thanks in advance for any advice

Share this post


Link to post
Share on other sites

Please, does anyone use $bestsellersboxonly and how did you get it to work? Is it not ready for use in the latest STS?

Share this post


Link to post
Share on other sites
Thanks for the help Bill! I'm having a small problem at the moment trying to install a contribution which displays a login box on the home page similar to site below

 

http://www.prozis.com/

 

I'm using the contribution

 

http://www.oscommerce.com/community/contri...ons,2538/page,9

 

Everything is installed its just when i come to using the PHP code to include it in sts_template.html i get the following error

 

Code:

// BOF: WebMakers Added: Login Box My Account

require(DIR_WS_BOXES . 'loginbox.php');

// EOF: WebMakers Added: Login Box My Account

 

Error: Fatal error: Call to a member function on a non-object in /home/wwwmacr/public_html/templates/custom1/includes/functions/html_output.php on line 78

 

Thanks in advance for any advice

James, have you created the box in the sts_user_code.php file so that you will have a STS tag for your custom login box? You will not want to insert the box PHP code directly in your HTML template. You should insert it in the sts_user_code.php file instead and then use a STS tag in your template where you want the box to appear.

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 am trying to use $bestsellersboxonly but the notification box still shows instead of bestsellers in the product information page. Doesn't $bestsellersboxonly works as it should?

Are you using the $notificationbox or $bestsellersbox tags in combination with the $bestsellersbox_only tag? If so, then that is the problem.


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

Bill, thank you. That wasn't the issue.. I can't remember what I did when I tried last time, I probably wrote $bestsellersboxonly without the underscore.. :blush:

Share this post


Link to post
Share on other sites
Thomas, what HTML code are you using to try to get your Flash Banner to work? I'm assuming that your error is within the HTML code that you are using in your template to try to get the Flash Banner to work.

Post just the HTML that relates to the banner.

 

 

OK I hope that I am attaching the correct html code in here. Hope this helps me solve the issue...

 

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="780" height="175">
         <param name="movie" value="icecream.swf">
         <param name="quality" value="high">
         <embed src="icecream.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="780" height="175"></embed>
       </object>

Share this post


Link to post
Share on other sites
OK I hope that I am attaching the correct html code in here. Hope this helps me solve the issue...

 

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="780" height="175">
<param name="movie" value="icecream.swf">
<param name="quality" value="high">
<embed src="icecream.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="780" height="175"></embed>
</object>

Try this:

 

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="780" height="175">
<param name="movie" value="images/icecream.swf">
<param name="quality" value="High">
<embed src="images/icecream.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="780" height="175" quality="High"></object>

 

I'm assuming you are uploading your flash file in your images directory.


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

Hi, i'm trying to find a login box contribution that is combatible with STS, has anyone used one/come accross one?

 

EDIT: Forgot to add this is what i mean by a login box

 

http://www.prozis.com/

Edited by tuna1

Share this post


Link to post
Share on other sites

I dont get it. I have been playing around with STS quite a while now and my shop design has come a long way. But I simply dont understand how to use product_info.php.html.

 

I simply copied the file from the full template over to my template and renamed it (cutout the "_26") and gave the admin panel all information. It looks all fine except for this error message:

 

Warning: include(includes/modules/sts_inc/product_info.php.html) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\clean\catalog\includes\modules\sts_inc\sts_display_output.php on line 21

Warning: include() [function.include]: Failed opening 'includes/modules/sts_inc/product_info.php.html' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\clean\catalog\includes\modules\sts_inc\sts_display_output.php on line 21

 

An hour of searching on the net and this forum raised the question a couple of times, but I couldnt find a solution...

 

So, what am I doing wrong?

 

Oh, I am using STS 4.5.2 on a clean install.

 

Thanks for any help or comments...

 

Chili_666

P.S. @tuna1:

 

Try this one. Seems to work and looks good. ;-)

Share this post


Link to post
Share on other sites

From admin > Modules > STS, remove the product info module and install it again. Enable it. Nothing else. Now it should work.

 

The admin parameters of the STS modules are not made to include templates, but extra php code to create placeholders. Default parameters will work for everybody.

 

Modules find the templates by themselves, based on file names and product ID or category ID. if you are interested, open one module and look the find_template function.

 

- chris


STS v4.5 SP5 is out, and check the STS Power Pack contribution too!

New thumbnailer using phpThumb: oscThumb. Works great.

Share this post


Link to post
Share on other sites

Hey thanks to the one that helped me with my flash banner by the way....

 

Just one more quick question....I have changed most of my colors in the stylesheet and STS, but I can not find where to change the background colors for the product descriptions. The place where you click on a catergory and it displays like this

 

 

image price decription add to cart

 

It still has the orginal color of the website, and I want to change that, does anyone know what file I need to look into???

Share this post


Link to post
Share on other sites
Hello, could somebody please help me: I need to know what code to add to my sts so that if someone choses to see the site in English they get one template and if they decide to see it in Spanish they get another template. Rigadin suggested I add some code but I don't know PHP so I would appreciate if someone can help me on this or tell me an easier way to use different templates for each language (my templates usually use flash headers and menus).

 

Or maybe if one of the latest sts versions already supports this?

Hello Sven...

Chris (rigadin2) came up with a solution to this issue a while back:

 

As you can include php inside your templates, you can do a lot of different things!

 

When writing php code inside your template, you have to remember that the template file is included from within the sts class, so you have access to sts class properties and methods by using '$this->' variable, but you don't have access to "outside" variables without using a 'Global' definition.

 

Simple example for language specific templates:

Create templates named template_1.html for language id 1, template_2.html for ID 2 and so on for how many languages you need.

 

In sts_default.html, add the following code:

<?php
Global $languages_id;
includes (STS_TEMPLATE_DIR.'template_'.$languages_id.'.html');
?>

Now, when the user selects language id 1, then STS will use template_1.html.

 

If you happen to design this really deep within your shop, why not repost with some examples of your advanced template names per language for the benefit of everyone else? I'm sure there are many that would appreciate that. :thumbsup:

 

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

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

×