Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

I also have the same problem

 

Everything works fine, including HTC, until I activate use template for infoboxes; the template just gets destroyed after information box; I however don't find any box.php file in this contribution (very last version 4.5.6)

Is admin/includes/classes/box.php is the right file?

 

Can this have any relation with the fact that i use HTC (header tags controller), or is an independent problem?

 

What problem would that be? The post that you referred to had a problem finding the latest version of STS.

 

I just looked at the lastest "full" version (not one of the upgrades) and the classes/boxes.php file is in there.

:thumbsup: In order to get STSv4.5.6, you first have to install the complete package STSv4.5.4. Then, to get all of the bug fixes since STSv4.5.4, you need to install the upgrades of STSv4.5.5 and STSv4.5.6. These upgrades are actually service packs to the full STS4.5.4 version.

 

I agree, it gets confusing when a full package is not uploaded for each service pack release. Maybe I will upload a complete full version that includes all of the latest bug fixes and service packs this weekend. :rolleyes:

 

See my link below on how to properly install HTC along side of STS.

 

Hope this helped,

 

Well actually I have the same Problem, after a fresh installation from 4.5.4 and upgrade to 4.5.6 the "Use template for infoboxes" option did screw up the layout for me.

After comparing boxes.php there was no solution. I looked in de changelog from archive 4.5.5 and found a change in "includes/functions/sts.php".

I then copied the 4.5.4 includes/functions/sts.php file to my server and everything is working fine again.

 

What is the impact in my sts installation that i use an older version of "includes/functions/sts.php"?

Link to comment
Share on other sites

A minor problem with secure pages + seo urls + STS. It loads the default template and not the SSL template so the images are broken and the page isnot secure.

 

I have the other SSL files working just fine (account.php, checkout etc..), it is the order id that sts is looking for.

 

Example problem url:

https://mysite.com/catalog/account_history_...php/order_id/25

 

if I upload a file called 25.html in the \catalog\includes\sts_templates\test\ directory then the page looks fine for this order id but not any other order id.

 

So it seems that the problem is STS looks for the template of the order id. So how do I tell STS to use one template for any order id?

 

STS does not work correctly with Search Engine Friendly URL enabled, because URL looks like you have only folders (no .php nor .html file in URL), so the original php script is unknown to STS.

 

STS works fine with Ultimate SEO URL's from Chemo.

 

To address this problem we need to tell STS to use only one template instead of looking for the template called 25 as in the example above.

 

So where could I tell STS to use the template for account_history_info.php when the page is only numbers?

 

Where does STS choose the teplate, or in what file does it look in the \catalog\includes\sts_templates\test\ directory for the template. I could make a if page name only has numbers then use the account_history_info.php template

 

Thanks.

Link to comment
Share on other sites

well it has been a while for me to chime in this forum. Kudos to bkellum and rigadin2 for supporting this addon. I see so many new mods related to STS. I am still using STS v 4.2 which dates back to 10 Aug 2006, could you advise what upgrades are needed to get the latest in templating.

 

current store setup:

osCommerce 2.2 milestone 2 update 060817

STS v 4.2

 

which of these are necessary? are there any other recommended mods related to STS?

upgrade osCommerce v2.2 Milestone 2 update 060817 to osCommerce v2.2 RC1

STS 4.5.7 for 2.2MS2 and RC1 Fredrik.r 23 Oct 2007

STS4 Power Pack dcross02 19 Sep 2007

 

thx for the help

Link to comment
Share on other sites

Okay I found the solution to the SSL + sts + seo problem.

 

Here is how I disabled the SEO urls for the SSL pages.

 

in \catalog\includes\functions\html_output.php

Find

	  $link = str_replace('?', '/', $link);
  $link = str_replace('&', '/', $link);
  $link = str_replace('=', '/', $link);

  $separator = '?';

}

 

and replace with this

if ($connection == 'NONSSL') { 
  $link = str_replace('?', '/', $link);
  $link = str_replace('&', '/', $link);
  $link = str_replace('=', '/', $link);

  $separator = '?';

 }
}

Edited by nextprevious
Link to comment
Share on other sites

Well, it appears this WAS NOT an STS issue but a coding issue related to the SEO contribution.

I'm not sure why you had any problems with STS and SEO since many have used the two together without any custom modifications to either the SEO or STS code.

 

 

Okay I found the solution to the SSL + sts + seo problem.

 

Here is how I disabled the SEO urls for the SSL pages.

 

in \catalog\includes\functions\html_output.php

Find

	  $link = str_replace('?', '/', $link);
  $link = str_replace('&', '/', $link);
  $link = str_replace('=', '/', $link);

  $separator = '?';

}

 

and replace with this

if ($connection == 'NONSSL') { 
  $link = str_replace('?', '/', $link);
  $link = str_replace('&', '/', $link);
  $link = str_replace('=', '/', $link);

  $separator = '?';

 }
}

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

well it has been a while for me to chime in this forum. Kudos to bkellum and rigadin2 for supporting this addon. I see so many new mods related to STS. I am still using STS v 4.2 which dates back to 10 Aug 2006, could you advise what upgrades are needed to get the latest in templating.

 

current store setup:

osCommerce 2.2 milestone 2 update 060817

STS v 4.2

 

which of these are necessary? are there any other recommended mods related to STS?

upgrade osCommerce v2.2 Milestone 2 update 060817 to osCommerce v2.2 RC1

STS 4.5.7 for 2.2MS2 and RC1 Fredrik.r 23 Oct 2007

STS4 Power Pack dcross02 19 Sep 2007

 

thx for the help

 

Nice to hear from you again.

 

I think the best thing to do is compare your stores files with the latest STSv4.5.7 and make the changes. I know rigadin2 is working on a new release that has some added features so you may want to wait until then. I know some of the added features are already available in the STS Power Pack site. Keep in mind, the STS Power Pack is not a contribution but more of a collection of STS add-ons to any STSv4x version.

 

I highly recommend to at least upgrade to STSv4.5.4, service pack 5 to get the latest bug fixes to STS.

 

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

Link to comment
Share on other sites

Nice to hear from you again.

 

I think the best thing to do is compare your stores files with the latest STSv4.5.7 and make the changes. I know rigadin2 is working on a new release that has some added features so you may want to wait until then. I know some of the added features are already available in the STS Power Pack site. Keep in mind, the STS Power Pack is not a contribution but more of a collection of STS add-ons to any STSv4x version.

 

I highly recommend to at least upgrade to STSv4.5.4, service pack 5 to get the latest bug fixes to STS.

 

Hope this helped,

Thx for the quick reply Bill. Looking at the install.html inside the STS v 4.5.7, it says:

2. Installation:

2.1 The package contains:

 

The package contains 4 folders

 

* Folder "STS": STS files.

* Folder "Files for MS2": files to copy over a fresh osCommerce 2.2MS2 (060817) installation.

* Folder "Files for RC1": files to copy over a fresh osCommerce Online Merchant 2.2RC1 installation.

* Folder "Doc" contains this file as well as other documents for the use of STS.

 

If you have not yet upgraded your osCommerce store to osCommerce Online Merchant RC1, you are welcome to do it as there are several security patches. Go to “http://oscommerce.com/downloads” to get it.

I suppose that the upgrade osCommerce v2.2 Milestone 2 update 060817 to osCommerce v2.2 RC1 step has to be done first prior to upgrading STS v4.2 to STS v4.5.7 , what do you think?

Link to comment
Share on other sites

Thx for the quick reply Bill. Looking at the install.html inside the STS v 4.5.7, it says:

I suppose that the upgrade osCommerce v2.2 Milestone 2 update 060817 to osCommerce v2.2 RC1 step has to be done first prior to upgrading STS v4.2 to STS v4.5.7 , what do you think?

That would be the case only if you intend to upgrade to RC1. If you want to keep your 060817 osCommerce version, then just upgrade your STS using the STS and MS2 folders.

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Are there any free templates to download which can be used with the STS-Template System ?

 

Millions!

 

Just to clarify...STS allows you to use "any" web templates available and then integrate osCommerce functionality within it. So...that means you can find a template out there that you like and then start plugging in the STS tags to bring in the osCommerce functions like the infoboxes, content, shopping cart, etc.

 

STS comes with some sample templates that mirror what a stock osCommerce shop looks like from a new install. You, of course, do not have to stick with that look (that's why we all use STS in the first place). :lol:

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

I installed the system and it seem to work.

Just to try it out, I made a new folder "lingerie" in catalog/includes/sts_templates/lingerie" and called it "sts_lingerie_template.html".

 

so far - so good.

 

Than i inserted a hard coded link to:

"..../contact_us.php"

 

But the page "contact_us.php dosen`t open - only the front page is to see....

 

What els do I have to do ?

 

An what about other OSC-Pages like "specials.php" and other pages - do I have to make a template-page for each ?

OSC Webmakers Edition modiefied with many other contribs and enhancements.

+ STS 4.5.7 for 2.2MS2 and RC1

Link to comment
Share on other sites

Can someone Please help me?

 

I have 2.2rc1 and STS 4.5.6 working fine. I've used it for a few versions now and love it.

I am having a problem though.

 

I want to use templates for product_info.php ... but I changed the name of the product_info.php file and now the module doesn't work. I tried adding my file to the scripts to use for the module in the admin but that didn't do it. I know I should just have to change the name of the file in a few places but for the life of me I can not get this to work.

 

Any help that anyone could lend would be greatly appreciated.

Link to comment
Share on other sites

If you have renamed product_info.php to product.php for example, you also have to rename includes/modules/sts/sts_product_info.php. After renaming this module, open it, change the name of the class, the name of the first method (=the constructor method) and the $this->code variable according to your new name. Your templates should still be named product_info.php.html, but you can also change it in the module if you like.

 

Small explanation:

When starting, STS check if it finds a module with the same name as the page. If there is such module, it checks if it is enable or not. If not, it uses the default module. If module is enabled, STS asks the module what template to use by calling the "find_template ()" method of the module.

 

One more thing, you have to rename the language file too, otherwise you'll have warnings in admin.

 

- Chris

Link to comment
Share on other sites

I installed the system and it seem to work.

Just to try it out, I made a new folder "lingerie" in catalog/includes/sts_templates/lingerie" and called it "sts_lingerie_template.html".

 

so far - so good.

 

Than i inserted a hard coded link to:

"..../contact_us.php"

 

But the page "contact_us.php dosen`t open - only the front page is to see....

 

What els do I have to do ?

 

An what about other OSC-Pages like "specials.php" and other pages - do I have to make a template-page for each ?

 

You do not have to make a template for each page, STS needs at minimum the default template (name is defined in admin default STS module, "sts_template.html" by default).

If you place a link on your template to contact_us.php page, the link must be relative to the catalog (= to the folder where are all your pages, like index.php), so link should just be "contact_us.php".

 

One remark: it is better to create a new placeholders for your link, or use the tep_href_link function in your template, then place a hardcoded link. Like this you keep the osCommerce functionalities (session ID, url rewrite, ...)

 

- Chris

Link to comment
Share on other sites

I have a problem with STS template. STS doesn´t clear all html of the original template. So now I´ve got this in top of my page (if you click (right mouse button) -> Show source):

 

<!-- categories //-->
         <tr>
           <td>
<!-- information //-->
         <tr>
           <td>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="LTR" lang="nl">
<head>

 

If you don't see what I mean: the categories and information <tr> and <td> in top of the code are not supposed to be there.

It is screwing up my layout so if anyone could help me with this problem I would be most thankfull.

Link to comment
Share on other sites

I have a problem with STS template. STS doesn´t clear all html of the original template. So now I´ve got this in top of my page (if you click (right mouse button) -> Show source):

 

<tr>
<td>

<tr>
<td>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="LTR" lang="nl">
<head>

 

If you don't see what I mean: the categories and information <tr> and <td> in top of the code are not supposed to be there.

It is screwing up my layout so if anyone could help me with this problem I would be most thankfull.

Edwin,

How do you have STS setup in the admin? Try the default settings to see if that corrects your problem. Also, try the default templates to rule out an issue with your custom templates.

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Edwin,

How do you have STS setup in the admin? Try the default settings to see if that corrects your problem. Also, try the default templates to rule out an issue with your custom templates.

 

Hi Bill,

 

Well I have installed the latest version and the problem only occurs when I have set the option "Use template for infoboxes" to true.

 

I hope you can help me.

 

Edit: Well I have solved it. It is very strange but when I added the following attributes to the HTML tag it worked.

xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl"

Edited by esbosveld
Link to comment
Share on other sites

2 Questions:

1.) How to define default Header Title or Text headings in a template depending on language ?

 

For examble:

HEADER_TITLE_CART_CONTENTS

 

The Text Tags are defined in "catalog/german.php" (or english.php)

 

2.) http://www.run-x.de/shop-2/catalog/login.php

 

...there is no login form visible.... :huh:

OSC Webmakers Edition modiefied with many other contribs and enhancements.

+ STS 4.5.7 for 2.2MS2 and RC1

Link to comment
Share on other sites

hello all,

 

i am using the STS v2.01 because that was what was originally installed on my site so havent changed it. it does not have sts installed as the module or even the sts.php file in classes.

 

this is my version

 

<!-- Page layout by Simple Template System (STS) v2.01 on osCommerce 2.2-MS2 - http://www.diamondsea.com/sts/ -->

<!-- Using Template File [includes/sts_template.html) -->

 

all my sts files which are the following are under catalog/includes

 

sts_display_output.php

sts_product_info.php

sts_restart_capture.php

sts_start_capture.php

sts_stop_capture.php

sts_template.html

sts_user_code.php.

 

how do i integrate this with Meta Tag Controller Support which is at http://addons.oscommerce.com/info/3357.

 

all instructions are for Installation for STS 4.3. can any one help ?

 

thanks

 

amit

Link to comment
Share on other sites

I'm having a very strange problem when I use Infobox templates.

I've just installed a fresh copy of osCommerce v2.2 RC1 and then added a fresh copy of STS v4.5.7 on top of it. If I use the Full template with "Use template for infoboxes" off, everything looks okay. But as soon as I turn "Use template for infoboxes" the page format goes haywire. It looks like the first few lines of the infobox templates are being truncated.

 

For example, this what the debug output shows for the Information Box when "Use template for infoboxes" is off.

<!-- start informationbox //-->

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading">Information</td>
<td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td class="boxText"><a href="http://localhost/workbench/UpYoursX.com/shipping.php?osCsid=63a2680374c8a0b48e1b6b39563adb23">Shipping & Returns</a><br><a href="http://localhost/workbench/UpYoursX.com/privacy.php?osCsid=63a2680374c8a0b48e1b6b39563adb23">Privacy Notice</a><br><a href="http://localhost/workbench/UpYoursX.com/conditions.php?osCsid=63a2680374c8a0b48e1b6b39563adb23">Conditions of Use</a><br><a href="http://localhost/workbench/UpYoursX.com/contact_us.php?osCsid=63a2680374c8a0b48e1b6b39563adb23">Contact Us</a></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>

<!-- end informationbox //-->

 

And this is what the the debug output looks like when when "Use template for infoboxes" is on.

	*</td>
<td background="images/infobox_03.gif" class="infoBoxHeading" width="1428">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td width="100%" class="infoBoxHeading">Information</td>
 </tr>
</table>
</td>
<td width="103" style="background-repeat: norepeat">
*</td>
 </tr>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#00FF00" style="border-collapse: collapse" bordercolor="#111111">
 <tr>
<td> </td>
<td bgcolor="#DBF1FF"><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
<td class="boxText"><a href="http://localhost/workbench/UpYoursX.com/shipping.php?osCsid=16ae952b96df3ac83a0067af2098ff71">Shipping & Returns</a><br><a href="http://localhost/workbench/UpYoursX.com/privacy.php?osCsid=16ae952b96df3ac83a0067af2098ff71">Privacy Notice</a><br><a href="http://localhost/workbench/UpYoursX.com/conditions.php?osCsid=16ae952b96df3ac83a0067af2098ff71">Conditions of Use</a><br><a href="http://localhost/workbench/UpYoursX.com/contact_us.php?osCsid=16ae952b96df3ac83a0067af2098ff71">Contact Us</a></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
<td> </td>
 </tr>
 <tr>
<td width="30"> </td>
<td width="100%"> </td>
<td width="31"> </td>
 </tr>
</table>			
<!-- end informationbox //-->

 

The following three lines from the infobox_information_header.php.html file are being dropped. There are other examples as well.

<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#00FF00">
 <tr>
<td width="11">

Has anybody seen anything like this before? I'm at my wit's end.

Link to comment
Share on other sites

Hi Bill,

 

Well I have installed the latest version and the problem only occurs when I have set the option "Use template for infoboxes" to true.

 

I hope you can help me.

 

Edit: Well I have solved it. It is very strange but when I added the following attributes to the HTML tag it worked.

<!-- categories //-->
         <tr>
           <td>

 

For some reason the categories box is no longer in a table of its own. I decided to test this out using a fresh install of OSC 2.2 RC1 with STS 4.5.7. Using the default "full" template from sts. It is causing the same problem.

 

here it is.:

http://dev.overlandgears.com/osc/index.php

 

Of course this only happens when use infobox templates is turned on.

Edited by soldsep
Link to comment
Share on other sites

I was having the same problem you where having except when I added that attribute to my HTML tag it did not fix the problem. I went into boxes/categories.php removed this line

<!-- categories //-->
         <tr>
           <td>

 

For some reason the categories box is no longer in a table of its own. I decided to test this out using a fresh install of OSC 2.2 RC1 with STS 4.5.7. Using the default "full" template from sts. It is causing the same problem.

 

here it is.:

http://dev.overlandgears.com/osc/index.php

 

Of course this only happens when use infobox templates is turned on.

what is involved in upgrading from an old sts version of the template to the latest one ? i have sts version 2.01 and because of that i am not being able to add new stuff on the site because all the contributions are done for version 4.

 

can any one help ?

Link to comment
Share on other sites

Just as an experiment, I installed v4.5.4. The problem that we are seeing does not manifest itself there. This is just a shot in the dark, but I could there be a problem with the strip_unwanted_tags() function?

 

james

Edited by thoughtscape
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...