Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Are you sure you don't have something in your stylesheet.css that may be overiding your changes? Also, have you modified the specials.php file in any way that might prevent the template from working?

 

You should be using STSv4.5.5 for the infobox templates to be working as designed.

 

My stylesheet infobox portion:

 

...

 

Thanks for taking your time to help me, it was just a stupid mistake by me. I forgot php.html, I just namned it infobox_specials.html

Share this post


Link to post
Share on other sites
I think I had problems with 4.5.6 since that version didn't include the service pack 2, which was uploaded earlier. The infobox templates didn't work and the template became a real mees when settings infobox templates 'true' in admin. Therefor I uploaded a 4.5.7 with all recent changes (4.5.4 + 4.5 SP5 + 4.5.6).

The 4.5.6 is the problem. The thought is good but it is incomplete.


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
Seems like it is working fine with relative links in templates and without using "force cookies". Could it be issues in just some browsers the way I am doing it? I have not experienced problems using Safari and Firefox. I think I had problems with cart loosing products a couple of years ago, but not nowadays.

 

Relative links are the way to go, especially for your images and if you are using a SSL cert.

 

Sounds like you have it setup correctly then. "mysql" should be set to handle the sessions. This is configured in the catalog/admin/includes/configure.php and catalog/includes/configure.php.

define('STORE_SESSIONS', 'mysql');

A good way to make links:

STS Link to a category:

 

<a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a>

 

STS Link to a product:

 

 

<a href="<?php echo tep_href_link('product_info.php', 'products_id=53&', 'NONSSL'); ?>">Product Name Here</a>


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

Does anyone know how to remove the white space from the left and right columns caused by the middle content on being too long? Here are some screenies on what I'm talking about :

 

http://img42.imagevenue.com/img.php?image=..._122_1087lo.JPG

http://img12.imagevenue.com/img.php?image=...e_122_730lo.JPG

 

I tried editing my sts_template and making my table's, where my columns are called/created, background color to my "main" background color of my site. Alas to no avail. Here's my sts_template, and the bolded part is where my column tables are located. (Nevermind, the bold doesn't show up in the code) <_<

 

<html>
<head>
<!--$headcontent-->
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<style type="text/css">
<!--
.style1 {font-size: 11px}
-->
</style>
</head>
<body>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" class="site_table" >
 <tr>
<td><table width="100%"  cellpadding="0" cellspacing="0">
 <tr class="header"><center> 
<td> $header</td>
 </center>
 </tr>
</table>
<table width="100%"  cellpadding="0" cellspacing="0">
 <tr class="headerNavigation"> 
<td class="headerNavigation">$breadcrumbs</td>
<td class="headerNavigation"><div align="right">$myaccount 
	| $cartcontents | $checkout</div></td>
 </tr>
</table> 
[b]<table width="100%"  cellpadding="0" cellspacing="0" bgcolor="#1e2b30">[/b]
 <t> 
<td class="left" width="155" valign="top" bgcolor="#1e2b30">	  $categorybox</br></br>$informationbox</td>
<td valign="top">
<table class="content" width="100%"  border="0" cellspacing="0" cellpadding="0">
 <tr>
<td><p>$breadcrumbs$content</p></td>
 </tr>
</table>
  </td>
<td width="155" valign="top" class="right">	$cartbox   $maninfobox   $orderhistorybox   $bestsellersbox$specialfriendbox$reviewsbox$languagebox$currenciesbox</td>
 </tr>
</table>[/b]
<table width="100%"  cellpadding="0" cellspacing="0">
 <tr> 
<td><div align="center">$footer</div></td>
 </tr>
</table>
</td>
 </tr>
</table>
<table width="758" align="center"  cellpadding="0" cellspacing="0">
 <tr> 
<td><div align="center" class="style1">$banner</div></td>
 </tr>
</table>
<p> </p>
</body>
</html>

Edited by z4games

Share this post


Link to post
Share on other sites
Relative links are the way to go, especially for your images and if you are using a SSL cert.

 

Sounds like you have it setup correctly then. "mysql" should be set to handle the sessions. This is configured in the catalog/admin/includes/configure.php and catalog/includes/configure.php.

define('STORE_SESSIONS', 'mysql');

A good way to make links:

STS Link to a category:

 

<a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a>

 

STS Link to a product:

 

 

<a href="<?php echo tep_href_link('product_info.php', 'products_id=53&', 'NONSSL'); ?>">Product Name Here</a>

 

 

Hi!

 

Yes, mysql is set to store sessions.

 

That was the interetsting part, "a good way to make links", which I don't really understand. Is it good in coding point of view / the correct way? Because I do not have issues with links vs sessions when not using links this way.

 

This might be off topic, not sure, but I am not getting https only during checkout, even if I have configured SSL in configure.php and ONLY use relative paths in templates. Some boxes, categories.php for example, use http links on secure pages (login, checkout) causing warnings in Explorer and Firefox. Really strange.. Could this be related to STS in some way?

Share this post


Link to post
Share on other sites
Does anyone know how to remove the white space from the left and right columns caused by the middle content on being too long? Here are some screenies on what I'm talking about :

 

http://img42.imagevenue.com/img.php?image=..._122_1087lo.JPG

http://img12.imagevenue.com/img.php?image=...e_122_730lo.JPG

 

Take a look at this post regarding tips on how to troubleshoot this type of issue:

 

http://forums.oscommerce.com/index.php?s=&...t&p=1157088

 

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
The guy who made v4.5.6 did not test in all situations. But he is right that only cleaning is faster than destroying, but it's just not working in all situations. Have to study how to get the speed effect without breaking the layout...

 

:thumbsup: A new STS version is available: STSv4.5.8

 

- BUG FIXED: STSv4.5.6 introduced a bug regarding how the buffer was cleaned. STSv4.5.8 reverts back to STSv4.5.5 method of destroying the buffer to allow cascading buffers. Files modified: catalog/includes/classes/sts.php.

 

- Added new STS placeholder $langid to allow dynamic images according to the language selected by the user.

 

- Merged STSv4.5.4 and STSv4.5.5 by Rigadin into STSv4.5.8.

 

- Updated documents.

 

Enjoy,


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
Take a look at this post regarding tips on how to troubleshoot this type of issue:

 

http://forums.oscommerce.com/index.php?s=&...t&p=1157088

 

Hope this helped,

 

Whoa, thanks! It helped, and probably will help me more in the future, thanks for the tip/help Bill!

 

For those who have similar problems, my "left and right class" in my stylesheet, TD.left and TD.right, the background colors were set to white. Just change it to whatever background you want and viola!

Share this post


Link to post
Share on other sites
- Added new STS placeholder $langid to allow dynamic images according to the language selected by the user.

 

 

What about "dynamic Text cases" according to the language selected by the user ;)

 

Know what I mean ?

 

It would be good to place a free a text case in the template which is defined in catalog/includes/languages/german.php, english, php, espanol.php.....whatever.


OSC Webmakers Edition modiefied with many other contribs and enhancements.

+ STS 4.5.7 for 2.2MS2 and RC1

Share this post


Link to post
Share on other sites
What about "dynamic Text cases" according to the language selected by the user ;)

 

Know what I mean ?

 

It would be good to place a free a text case in the template which is defined in catalog/includes/languages/german.php, english, php, espanol.php.....whatever.

This is already a function in osCommerce. OsC is multi-language out of the box. Just define your text directly in the language files and STS will pick it up automatically just like a non-STS shop.

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
This is already a function in osCommerce. OsC is multi-language out of the box. Just define your text directly in the language files and STS will pick it up automatically just like a non-STS shop.

 

YEAH !

Got it...sometimes i only need an inspiration...

 

inserted

<?php echo HEADER_TITLE_CART_CONTENTS; ?>
and voila - Text is language sensitive...

 

Great ! :thumbsup:


OSC Webmakers Edition modiefied with many other contribs and enhancements.

+ STS 4.5.7 for 2.2MS2 and RC1

Share this post


Link to post
Share on other sites
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');
?>

 

Hi Bill,

Thanks for the easy and simple instructions for using a differant template per language in STS but I have a question, I hope u can clarify. You stated to add the above code to sts_default.html

I do not have any files with the name. I have sts_default.php in each of my language files along with modules file altho nothing made in .html Not sure if I am missing something or putting in wrong file. Can you please help?

 

Many thanks,

Demitra

Share this post


Link to post
Share on other sites
Brock,

A few things to consider:

  • How did you install STS? Did you use the RC1 files or the MS2 files?
  • Was it a manual install or did you just "copy" over the files from the contribution?
  • During the reinstall of STS, did you erase any custom code you may have added to your sts_user_code.php file? Did you erase any custom boxes from the boxes.php file?
  • During the reinstall of osCommerce, did you erase any custom CSS code to your stylesheet.css file?
  • Lastly, I can't vouch for the latest STS package but I feel confident enough with the member who bundled all of the bug fixes and updates that I'm sure that is not the problem, but you never know...

:thumbsup: Compare your old installation with your current setup by using a file comparison utility such as Beyond Compare or WinMerge. I know you kept a backup...didn't you? :blush:

 

Thanks Bill - I got it all straightened out thanks to you. I really appreciate it.

Share this post


Link to post
Share on other sites
Hi Bill,

Thanks for the easy and simple instructions for using a differant template per language in STS but I have a question, I hope u can clarify. You stated to add the above code to sts_default.html

I do not have any files with the name. I have sts_default.php in each of my language files along with modules file altho nothing made in .html Not sure if I am missing something or putting in wrong file. Can you please help?

 

Many thanks,

Demitra

That code was for an older version of STS.

 

Try this:

Simple Example for Language Specific Templates for STSv4.5.8:

  1. Create a home page template: index.php_0.html.
  2. Insert the following code just after the </head> section in your index.php_0.html:
    <?php
    Global $languages_id;
    include (STS_TEMPLATE_DIR.'sts_template_'.$languages_id.'.html');
    ?>


  3. Create your language templates as so (language ID may be different in your shop):

  • sts_template_1.html (1 is the language ID for english in my shop
  • sts_template_2.html (2 is the language ID for Dutch in my shop
  • sts_template_3.html (3 is the language ID for Spanish in my shop)

Now, depending upon which language the user selects in your shop they will be taken to the appropriate language template.

 

Hopefully all of the above works for you. :-

 

It may be better to make the switch to a different template folder instead of to a specific template_1 or template_2. By using a language template folder, you could just copy all of the different templates created for one language into each language template folder, make the language conversions, and then just send the user to that specific template_folder_$languages_id to look for the correct template page. Hmm...just something for you to consider.


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

Feeling a little silly here as I seem to be the only one who could not install!!

 

I followed all the instructions for a manual install (as I have other contrib's up and running) but did run into some mismatching that might have thrown me. I used the RC1 files during the install. I dropped the catalog from the path and have OSC loaded at the top level of the \public_protected. (I'm also using HTTPS)

 

in one section it states ...

 

2.4 Modify osCommerce file

 

catalog\admin\modules.php

 

but in 2.5.1 >> includes/modules.php (and this file does not seem to exist)

 

What has happened now is that if I log in I get a blank page even if the module is set to off ....

 

I have to login >.. get blank page >.. then re-type admin (in the url) and I get the admin page ....

 

I have been through the entire installation twice now and can not see where I went wrong.

 

One question ... when the instructions state "at end of file" is that before or after the final " ?> "

 

As you can see I am no programmer and any help at all would be greatly received.

 

Nigel.

Edited by Nigel_Aves

Share this post


Link to post
Share on other sites
Feeling a little silly here as I seem to be the only one who could not install!!

 

I followed all the instructions for a manual install (as I have other contrib's up and running) but did run into some mismatching that might have thrown me. I used the RC1 files during the install. I dropped the catalog from the path and have OSC loaded at the top level of the \public_protected. (I'm also using HTTPS)

:thumbsup: I would strongly suggest that you use a file comparison utility such as the free WinMerge or Beyond Compare (better) to do the manual installation. By doing so, you will not have any typos and you will be placing the code/files in the correct lines/folders.

One question ... when the instructions state "at end of file" is that before or after the final " ?> "

This means to add the code just before the ending PHP Closing tag "?>". Take a look at the files that are included and you will see where to add the code.

 

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

Hi

 

I am new to OSCommerce and STS although I am an experienced PHP programmer. I've installed OSC v2.2 RC1 and the latest STS 4.5.8.

 

Everything looks OK except, with the default template I get tags instead of side menus, eg:

 

$categorybox

$manufacturerbox

$whatsnewbox

 

etc. instead of the actual menus.

 

Have I missed something obvious? I've searched this thread and other parts of the forum and noone else seem to have had this problem. I'd really appreciate it if someone could point me in the right direction.

 

Thanks very much

 

Dakk

Share this post


Link to post
Share on other sites
Hi

 

I am new to OSCommerce and STS although I am an experienced PHP programmer. I've installed OSC v2.2 RC1 and the latest STS 4.5.8.

 

Everything looks OK except, with the default template I get tags instead of side menus, eg:

 

$categorybox

$manufacturerbox

$whatsnewbox

 

etc. instead of the actual menus.

 

Have I missed something obvious? I've searched this thread and other parts of the forum and noone else seem to have had this problem. I'd really appreciate it if someone could point me in the right direction.

 

Thanks very much

 

Dakk

Dakk, Are you using the sts_template.html as your default template? If not, have you changed the default template name in the STS Default Module?

 

I'm making a big assumption that you have the necessary code in the template such as:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html $htmlparams>
<head>
<meta http-equiv="Content-Language" content="en-us">
<!--$headcontent-->
 <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

 

Have you changed your end characters for you tags? See section 5.2.1 in the STS User Manual.


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 Bill

 

Thanks for the reply. Great idea for a template system by the way!

 

I am using the sts_template.html template in it's entirity. I have not changed the contents of this file at all.

 

The weird thing is that $headcontent, $breadcrumbs, $myaccountlogoff, $cartcontents, $checkout, $content etc. all seem to work fine - these are correctly picked up. Even the footer stuff works ok. The problem is just with the side menu boxes - all of the following display as unparsed tags:

 

$catmenu

$categorybox

$manufacturerbox

$whatsnewbox

$specialbox

$searchbox

$informationbox

$cartbox

$maninfobox

$orderhistorybox

$bestsellersbox

$reviewsbox

$tellafriendbox

$languagebox

$currenciesbox

 

 

If you've got any further ideas I'd really appreciate it.

 

Thanks very much

 

Dakk

Share this post


Link to post
Share on other sites

Hello,

 

Have you have the instructions to migrate STS 4.5.4 or 4.5.5 / 2.2MS2 / (rigadin2) to STS 4.5.8 (bkellum) ? :blush:

 

Thank's

Share this post


Link to post
Share on other sites

Bill - I have fixed the problem. For some reason I had not copied over the column_left.php and column_right.php files. I have done this and it now works.

 

Thanks for your help.

 

Dakk

Share this post


Link to post
Share on other sites
Hello,

 

Have you have the instructions to migrate STS 4.5.4 or 4.5.5 / 2.2MS2 / (rigadin2) to STS 4.5.8 (bkellum) ? :blush:

 

Thank's

It is very simple to do but I am walking out the door at the moment so I can't write it out for you.

 

For now, the best thing to do would to use a file comparison utility such as the free WinMerge or Beyond Compare (better) to merge in the code changes.

 

I can tell you that the MS2 and RC1 files are exactly the same. The files in the STS folder have been upgraded as well as the Docs folder.


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 all,

 

I want to use STS to create my first template, but I don't know the better way to do it.

I've already a visual I want to obtain in psd format (photoshop).

 

Can you tell me the most important step that required a template creation-integration (graphic and code) and the order of each one please ?

 

Thanks a lot.

Share this post


Link to post
Share on other sites

Can anyone point me in the correct direction? Using header tag controller and STS how do I get rid of lets see what we have here, I know it should be replaced by the category heading, were have i messed up?

Share this post


Link to post
Share on other sites
Can anyone point me in the correct direction? Using header tag controller and STS how do I get rid of lets see what we have here, I know it should be replaced by the category heading, were have i messed up?

 

Brian,

See the following post regarding making the edits to the catalog/index.php file for HTC and STS:

 

http://forums.oscommerce.com/index.php?s=&...t&p=1116611

 

Hope that helped you 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

×