Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

$banner# tag dosen't seem to work.

 

Anyeon ever run into this? It simply prints out the text $banner#.

 

I'm stumped, I am.

 

I'm running the most recent STS. Dosen't matter which template level I put it in, the banners simply don't get called. I haven't modded any files.

Share this post


Link to post
Share on other sites

Ok so my question will probably sound silly but whenever I try to create a template for a particular page (let's say specials.php.html) it doesn't do anything.

My default template default.html is used all the time except on product info where I have created a template for the content (in a subfolder called content as indicated in the documentation).

I have looked on the forum but it looks like it's working for everybody but me ...

So what am I missing here? Do I need to declare anything in one of the sts_inc files or change the configuration on the admin side?

 

I just can't find what I've done wrong ...

 

Thanks for your help

 

--

Arnaud

Share this post


Link to post
Share on other sites
Guest

I've just installed STS V4.4 . I intend to install also Header Tage Controller V2.6.2 and GoogleXMLSitemapv1.3 . I'm wondering if STS work with those contribution. Any advice ? thanks for sharing

 

Regards

Jason

Share this post


Link to post
Share on other sites
Guest

I've just installed STS V4.4 . I intend to install also Header Tage Controller V2.6.2 and GoogleXMLSitemapv1.3 . I'm wondering if STS work with those contribution. Any advice ? thanks for sharing

 

Regards

Jason

Share this post


Link to post
Share on other sites

I just started using STS and i think its nice. The one thing that I've noticed, is that when i use a template for specific categories, IE doesnt load the content. It will load the bg image and nothing else. However in firefox it will show up fine

 

IE:

http://stationaryandsuch.com/ss_cart/index.php?cPath=22

 

try that in IE and Firefox (for example), for me it doesn't load in IE.

 

Any suggestions?

Share this post


Link to post
Share on other sites
I've just installed STS V4.4 . I intend to install also Header Tage Controller V2.6.2 and GoogleXMLSitemapv1.3 . I'm wondering if STS work with those contribution. Any advice ? thanks for sharing

 

Regards

Jason

Jason, yes it actually makes HTC a lot easier to use. For example: You only have to add the keywords, etc in the HTC admin panel and STS will pick it up for all of your template pages. Take a look at the Power Pack link in my signature below.

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 just started using STS and i think its nice. The one thing that I've noticed, is that when i use a template for specific categories, IE doesnt load the content. It will load the bg image and nothing else. However in firefox it will show up fine

 

IE:

http://stationaryandsuch.com/ss_cart/index.php?cPath=22

 

try that in IE and Firefox (for example), for me it doesn't load in IE.

 

Any suggestions?

Donnie, be sure to check that you did not modify your categories.php file in such a way that it is causing these incompatibility issues in other browsers. You may also have installed a separate contribution that is causing these issues with osC & STS.

STS on it's own will not cause the issues that you are describing. It would have to be some existing code as mentioned above or maybe in your custom template itself. Try using all of the default templates and stylesheet.css and see if you are still having this issue. It's most likely some incompatible HTML code either in your categories.php file or in your template.

 

Hope this helped to point you in the right direction.


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 my question will probably sound silly but whenever I try to create a template for a particular page (let's say specials.php.html) it doesn't do anything.

My default template default.html is used all the time except on product info where I have created a template for the content (in a subfolder called content as indicated in the documentation).

I have looked on the forum but it looks like it's working for everybody but me ...

So what am I missing here? Do I need to declare anything in one of the sts_inc files or change the configuration on the admin side?

 

I just can't find what I've done wrong ...

 

Thanks for your help

 

--

Arnaud

Hello friend, Does your new template specials.php.html have the required code that is provided in the sts_blank_template.html? Did you upload this template into the same template folder as your default template that you know is working?

Also, check your settings in the STS Modules section to be sure they are in accordance with the installation instructions.

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
Hello friend, Does your new template specials.php.html have the required code that is provided in the sts_blank_template.html? Did you upload this template into the same template folder as your default template that you know is working?

Also, check your settings in the STS Modules section to be sure they are in accordance with the installation instructions.

Hope this helped,

Dear Bill,

my specials.php.html is simply a copy of the sts_blank_template.html where I have just changed the content to some "Hello World" kind of text. It is in the same folder as default.html and I have just checked the whole installation process again and everything is as it is supposed to be ...

The weird thing is if I just copy the content of specials.php.html and put it in index.php.html, the template applies correctly to the index page ...

Share this post


Link to post
Share on other sites

Bill,

 

As you adviced me, in order to solve my HTC problem, I upgraded my store with STSv4.3.3 with HTC 2.6.0 (Previous STS 4.2 ran fine, with HTC 2.5.9 with some problems). I verified 3 times all the concerned files with my file comparator.

Now, my STS layout has gone. If I disable all STS modules, I have osC default layout.

 

I have the following error message :

Fatal error: Cannot redeclare clean_html_comments() (previously declared in /includes/functions/clean_html_comments.php:11) in /includes/functions/clean_html_comments.php on line 11

 

I checked here several page before (165-166) a similar problem met by sukarya (http://forums.oscommerce.com/index.php?s=&showtopic=58541&view=findpost&p=981888) but his solution doesn't solved mine.

 

With STS modules set to false, the same templates configuration running in my store folders for previous version v4.2, I have now a blank page displayed with the previous fatal error.

If I comment require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); in includes/header_tags.php, default STS layout is displayed.

 

If I set STS Default module to true, I have a blank page.

If I set STS Default module to false and STS Index module to true, I have the default STS layout displayed.

And if I redeclare the require line in includes/header_tags.php, I always have a blank page for index.php with my Fatal error.

I tested with 755 and 777 permissions for both headertags files.

 

I really don't know what I can do. Every file of the STS contribution looks like the masters fitted in the contribution.

I tried, compared files of the STSv4.3.3 with HTC 2.6.0 bundle, also those of the STS 4.3 contribution.

I checked with the placeholders (from the chapter upgrade from...), no problem.

 

Perhaps I miss something. I really don't know, I checked all of that several times and didn't found anything wrong comparing with STS v4.3 files and mine.

 

I you have some suggestions, I will appreciate.

 

Thanks,

Jacques

 

 

PS : In the sts_history.pdf, I didn't understood what you mean with :

Changes have been made in the file “includes/classes/boxes.php”. Scripts in the

catalog that use the boxes class can now use their own template:

“catalog_FILENAME_header.php.html” and/or

“catalog_FILENAME.php.html”; while infoboxes will continue using the

templates “infobox_FILENAME_header.php.html” and/or

“infobox_FILENAME.php.html”.

Share this post


Link to post
Share on other sites
Donnie, be sure to check that you did not modify your categories.php file in such a way that it is causing these incompatibility issues in other browsers. You may also have installed a separate contribution that is causing these issues with osC & STS.

STS on it's own will not cause the issues that you are describing. It would have to be some existing code as mentioned above or maybe in your custom template itself. Try using all of the default templates and stylesheet.css and see if you are still having this issue. It's most likely some incompatible HTML code either in your categories.php file or in your template.

 

Hope this helped to point you in the right direction.

 

 

So if anyone has had any browser compatibilities at all, be sure to check out a few things that I came across:

Stylesheets: If you pull from a stylesheet.css file, AND one predefined with the page you're editing, you can cause some issues.

Example:

body {
background-image: url(http://www.stationaryandsuch.com/images/pattern1.gif);
}
.style1 {color: #FFFFFF}
.style2 {font-size: 12px}
.style3 {color: #FFFFFF; font-size: 12px; }

 

IE and safari have a few issues with all the font changes, and the font edits in your stylesheet.css

FIX?: Use one or the other, not both, like i did, getting browser issues.

ALSO:

Your categories.php file grabs from the style sheet also. If you have predefined styles in the actual php page, then it causes some issues also

 

KUDOS to bkellum, playing with stuff can cause problems :)

Edited by ClefRock

Share this post


Link to post
Share on other sites

I am struggling to get a handle on this whole osCommerce thing. I am hoping the template system will make my life easier. I have copied over all the files, and STS now shows under my modules menu, but when I click on it, the payment modules show. Can someone tell me what I'm doing wrong?

Share this post


Link to post
Share on other sites
Guest

Hi,

 

where would I go to get some paid support on STS 3?

Share this post


Link to post
Share on other sites
Bill,

 

As you adviced me, in order to solve my HTC problem, I upgraded my store with STSv4.3.3 with HTC 2.6.0 (Previous STS 4.2 ran fine, with HTC 2.5.9 with some problems). I verified 3 times all the concerned files with my file comparator.

Now, my STS layout has gone. If I disable all STS modules, I have osC default layout.

...

 

It seems a had something wrong in includes/header_tags.php.

I had to set the following declaration like that :

require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

 

HTC are running.

They are displayed twice if I check the source code.

 

Jacques

Share this post


Link to post
Share on other sites
I am struggling to get a handle on this whole osCommerce thing. I am hoping the template system will make my life easier. I have copied over all the files, and STS now shows under my modules menu, but when I click on it, the payment modules show. Can someone tell me what I'm doing wrong?
Brenda, it appears you either did not complete the installation or manually placed some of the code needed in the wrong location.

My suggestion would be to use a file comparison tool such as WinMerge or Beyond Compare to compare all of your store's files and folders to the files and folders in the STS contribution.

Note: In order to do a complete installation, you will need to do the following:

  1. Upload all of the files and folders in the "New_Files/catalog/" section of the contribution. Keep in mind you may or may not have a real folder called "catalog". It is not needed.
  2. Update your existing files/folders with the files/folders of the same name from the "modified_files" section of the contribution.


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
Dear Bill,

my specials.php.html is simply a copy of the sts_blank_template.html where I have just changed the content to some "Hello World" kind of text. It is in the same folder as default.html and I have just checked the whole installation process again and everything is as it is supposed to be ...

The weird thing is if I just copy the content of specials.php.html and put it in index.php.html, the template applies correctly to the index page ...

 

Dear Bill,

 

I finally found where the error came from. I am just surprised that nobody else got it but it only got added in the version 4.4 of STS.

Anyway I think the problem is coming from includes/modules/sts/sts_default.php in the function find_template().

You have to remove the { } on the if

if (strstr($scriptbasename, "popup") || strstr($scriptbasename, "info_shopping_cart")) {
return ''; // We don't use template for these scripts

$check_file = STS_TEMPLATE_DIR .$scriptbasename . ".html";

if (file_exists($check_file)) return $check_file;

 }

so that it becomes:

if (strstr($scriptbasename, "popup") || strstr($scriptbasename, "info_shopping_cart"))
  return ''; // We don't use template for these scripts

$check_file = STS_TEMPLATE_DIR .$scriptbasename . ".html";

if (file_exists($check_file)) return $check_file;

or else the function always returns an empty string.

 

Hope this helps ;)

Share this post


Link to post
Share on other sites
Dear Bill,

 

I finally found where the error came from. I am just surprised that nobody else got it but it only got added in the version 4.4 of STS.

Anyway I think the problem is coming from includes/modules/sts/sts_default.php in the function find_template().

You have to remove the { } on the if

if (strstr($scriptbasename, "popup") || strstr($scriptbasename, "info_shopping_cart")) {
return ''; // We don't use template for these scripts

$check_file = STS_TEMPLATE_DIR .$scriptbasename . ".html";

if (file_exists($check_file)) return $check_file;

 }

so that it becomes:

if (strstr($scriptbasename, "popup") || strstr($scriptbasename, "info_shopping_cart"))
  return ''; // We don't use template for these scripts

$check_file = STS_TEMPLATE_DIR .$scriptbasename . ".html";

if (file_exists($check_file)) return $check_file;

or else the function always returns an empty string.

 

Hope this helps ;)

Yes, I can confirm this bug in STSv4.4. Good Catch Arnaud!

The code should be changed as above or your custom templates for specific PHP pages in your store will always use the default template instead of the specific template you created for it.

 

I'm sorry I didn't see your post until now. I was actually fighting this same issue banging my head up against the wall wondering why in the world my custom scripts were being ignored in STSv4.4.

Thanks for the follow up post!! :thumbsup: :thumbsup: :thumbsup:


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

:thumbsup: Hello Everyone. I was recently asked offline to assist in how to create a "new page" in STS as well as create the link in the header navigation next to the "My Account" link. I'll post my guide here for all to benefit as well.

 

How to create new pages in your shop and then link to them in your STS template navigation:

OsCommerce has a file structure that you will need to adhere to so that everything works properly.

  1. FTP a copy of the following files from your store to your PC to be used as templates:
    "catalog/shipping.php".
    "catalog/includes/languages/your_language/shipping.php".
  2. On your PC, rename these files to something like "catalog/newpage.php" and "catalog/includes/languages/your_language/newpage.php".
  3. Now you will need to edit your copied newpage.php files.
    Open your "catalog/newpage.php" file and locate the following code:
    require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHIPPING);

    Change it to:

    require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEWPAGE);


    Find:

    $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHIPPING, '', 'NONSSL'));


    Change it to:

    $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_NEWPAGE, '', 'NONSSL'));


  4. Now edit the copied file "catalog/includes/languages/your_language/newpage.php".
    Find:
    define('NAVBAR_TITLE', 'Shipping & Returns');<BR>define('HEADING_TITLE', 'Shipping & Returns');


    Change it to:

    define('NAVBAR_TITLE', 'Newpage Template');<BR>define('HEADING_TITLE', 'Newpage Template');


  5. Download a copy of "catalog/includes/filenames.php" to your PC. Add the following line of code:
    define('FILENAME_NEW_PAGE', 'newpage.php');


  6. Download a copy of "catalog/includes/modules/sts_inc/sts_user_code.php" from your store to your PC.
    Now add the following line to your “includes/modules/sts_inc/sts_user_code.php” file:
      /*New Page Template link below. Change "newpage" to whatever your actual new page name is */<BR>  $sts->template['urlmynewpage'] = tep_href_link(FILENAME_NEWPAGE, '', 'SSL');<BR>  $sts->template['newpage'] = '<a href=' . tep_href_link(FILENAME_NEWPAGE, '', 'SSL') . ' class="headerNavigation">' . 'New Page' . '</a>';


    The code above represents the following:
    STS tag: $urlmynewpage (use this tag to create a link to your new page anywhere in your STS Template)
    File Name: newpage.php
    File Location: catalog/includes/languages/your_language/newpage.php (Actual PHP page that will be templated with STS)
    STS Template File Location: sts_templates/my_template_folder/newpage.php.html (to be created by you)
    Actual Text Link: New Page
    CSS Class: headernavigation (you can leave this out or change to whatever class you want)

  7. Upload all four files to:
    "catalog/newpage.php"
    "catalog/includes/languages/your_language/newpage.php" ("your_language" will be for each language folder that you use)
    "catalog/includes/filenames.php"
    "catalog/includes/modules/sts_inc/sts_user_code.php"

In each of the above steps, easily substitute "newpage" with the actual name of the page that you want to add and "New Page" for the link text you want to appear in your template.

 

Hope this little guide has helped,

Bill Kellum

Sounds Good Productions


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
Guest

Hi guys/gals

 

Just another n00b here and learning more and more about STS so i hope you can help me out here

 

i can't seem to find the answer i am looking for, i've installed OScommerce, and also STS 4 (all working) i have edited my sts_template to my liking, but how to i upload it as my index page? or do i run it as default from the STS module? because i have read on the page before i started editing it say that this is only a template and the customer will no be bill etc etc..

 

If anyone can share some light here it would be great

Edited by Azure Sky

Share this post


Link to post
Share on other sites
Hi guys/gals

 

Just another n00b here and learning more and more about STS so i hope you can help me out here

 

i can't seem to find the answer i am looking for, i've installed OScommerce, and also STS 4 (all working) i have edited my sts_template to my liking, but how to i upload it as my index page? or do i run it as default from the STS module? because i have read on the page before i started editing it say that this is only a template and the customer will no be bill etc etc..

 

If anyone can share some light here it would be great

Hello Kway,

You will need to initiate the use of STS by going into your Admin panel under Modules/STS, and then click the install button on the available STS modules that you want to use in your store. For example: If you do not want STS to use templates for your Popup Images, then you will not install the Popup Image Module.

To use STS in it's most basic setting, you will have to install at least the Default Module and then change the settings "Use Templates" to True.

The above is mentioned in the User Manual where you can find more detailed information.

Note: The page you mentioned appears to be the default osCommerce text from the [path to catalog]/includes/languages/english/index.php file. You will need to manually edit that page to remove all of the standard text so that it will not interfere with your templates.

Your code currently looks as so:

define('TEXT_MAIN', 'This is a default setup of the osCommerce project...');

 

You need to manually edit that code- it is important to keep the define() of the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the following example is used where only two single quote characters exist:

 

define('TEXT_MAIN', '');

Have fun,

Bill Kellum


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

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:

...how shoudl i do!? Thanks !!

Share this post


Link to post
Share on other sites

I am trying to make STS 4.4 and Header Tags Controller 2.6.2 to work with no luck.

 

I tried to follow the instructions in STS Power pack plus to see if that made a difference with no luck.

 

First error:

 

Fatal error: Cannot redeclare clean_html_comments() (previously declared in /hsphere/local/home/xxxx/xxxxx.xxx/osc/includes/functions/clean_html_comments.php:11) in /hsphere/local/home/xxxx/xxxxx.xxx/osc/includes/functions/clean_html_comments.php on line 11

 

Then in includes/header_tags.php i changed the following as described in this forum thread:

 

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

 

to

 

require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

 

Then I get this error:

 

Fatal error: Cannot redeclare tep_get_header_tag_products_title() (previously declared in /hsphere/local/home/xxxx/xxxxx.xxx/osc/includes/functions/header_tags.php:7) in /hsphere/local/home/xxxx/xxxxx.xxx/osc/includes/functions/header_tags.php on line 7

 

What is the problem?

Share this post


Link to post
Share on other sites
I am trying to make STS 4.4 and Header Tags Controller 2.6.2 to work with no luck.

 

I tried to follow the instructions in STS Power pack plus to see if that made a difference with no luck.

 

First error:

 

Fatal error: Cannot redeclare clean_html_comments() (previously declared in /hsphere/local/home/xxxx/xxxxx.xxx/osc/includes/functions/clean_html_comments.php:11) in /hsphere/local/home/xxxx/xxxxx.xxx/osc/includes/functions/clean_html_comments.php on line 11

 

Then in includes/header_tags.php i changed the following as described in this forum thread:

 

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

 

to

 

require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

 

Then I get this error:

 

Fatal error: Cannot redeclare tep_get_header_tag_products_title() (previously declared in /hsphere/local/home/xxxx/xxxxx.xxx/osc/includes/functions/header_tags.php:7) in /hsphere/local/home/xxxx/xxxxx.xxx/osc/includes/functions/header_tags.php on line 7

 

What is the problem?

Check the following first to rule out any permission issues:

Remember, there are two files that you need to change the permissions to in order for Header Tags Controller to work properly:

 

• catalog/includes/header_tags.php (CHANGE PERMISSIONS OF THIS FILE TO 755 OR 777)

• catalog/includes/lanquages/english/header_tags.php (CHANGE PERMISSIONS OF THIS FILE TO 755 OR 777)

 

Use the 777 first, but if your host will not allow you to do that then use the 755 instead.

 

Some hosts use different settings still and Header Tags will flag an error in those cases. The best thing to do is to check the permissions on the images directory and set the ones on the Header Tags files to the same.


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

×