Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Hello.

I am using STSv4.5.8 (on a clean RC2).

The installation is fine.

But:

I have a separate directory from which the template is loaded:

\includes\sts_templates\test\t1\

 

in that directory i have another one with the images of the template:

\includes\sts_templates\test\t1\images\

 

Everything is fine in the admin panel, and the template is loaded, but the images are not.

 

Trying to figure out why ...

I have to ask "why would you do that?"

It would work perfectly if you removed the extra folder and kept everything tidy in the template folder "test" or simply remove the "test" folder and keep everything in the "t1" 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

Ok, another question:

How to link my sts_template.html file with my own style.css file.

 

I have

<link rel="stylesheet" type="text/css" href="style.css">

in my sts_template.html file.

And i have a style.css file in the same directory, but they are not related.

 

:huh:

Share this post


Link to post
Share on other sites
Ok, another question:

How to link my sts_template.html file with my own style.css file.

 

I have

<link rel="stylesheet" type="text/css" href="style.css">

in my sts_template.html file.

And i have a style.css file in the same directory, but they are not related.

 

:huh:

This has been suggested many times (please search this thread):

 

<link rel="stylesheet" type="text/css" href="$templatedir/stylesheet.css">

 

Search the STSv4 thread using Google:

site:forums.osCommerce.com [Contribution] sts v4


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 reason that they are primarily just for categories is because categories are generated from dynamic PHP code and thus difficult for many to create on their own.

 

What other type of drop down menu are you looking for?

 

Hi Bill

 

I am really looking for a code that will allow me to set up a dropdown main navigational menu that will sit at the top of my page.... e.g. a heading of Info on rollover would display FAQ, Shipping, Returns, Discounts, etc...

 

I'm unlclear how I would incorporate say, a javascript code with the $new_products code headers for example.

 

Cheers

Sol

Share this post


Link to post
Share on other sites

I'm trying t o add the css category menu contrib but don't think I understand correct how to add a box?

from the code in sts_user_code.php do I need to modify the whole thing or just use the top part?

 

I tried this but I only get $

 

$sts->start_capture();
  require(DIR_WS_BOXES . 'categories_css.php');
  $sts->stop_capture('boxcategoriescss', 'box');

 

can someone please explain how to add that?

Share this post


Link to post
Share on other sites
I'm trying t o add the css category menu contrib but don't think I understand correct how to add a box?

from the code in sts_user_code.php do I need to modify the whole thing or just use the top part?

 

I tried this but I only get $

 

$sts->start_capture();
  require(DIR_WS_BOXES . 'categories_css.php');
  $sts->stop_capture('boxcategoriescss', 'box');

 

can someone please explain how to add that?

It may be easier for you to see how to do this if you use the sts_column_left.php file instead:

 

Find:

  $sts->restart_capture(); // Clear buffer but do not save it nowhere, no interesting information in buffer.
// Get categories box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }  
 $sts->restart_capture ('categorybox', 'box');

Add afterwards:

 

// Get categories css menu box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories_css.php');
 }  
 $sts->restart_capture ('boxcategoriescss', 'box');

Then, use the $boxcategoriescss tag in your template.


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

thank you very much for the reply.

I tried the code in the sts_column_left.php but I still get the same menu. even if I comment out the code for the regular category box I get the same category box, could that be from the cache?

this is how my code looks now

 

//Get categories box from db or cache  
if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }  
 $sts->restart_capture ('categorybox', 'box');  

// Get categories css menu box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_categories_box();
 }
 else {

include(DIR_WS_BOXES . 'categories_css.php');
 }  
 $sts->restart_capture ('categories_cssbox', 'box');


// Get manufacturer box from db or cache

 

 

SO then I tried just this instead

include(DIR_WS_BOXES . 'categories_css.php');
 $sts->restart_capture ('categories_cssbox', 'box');

 

that gives me the CSS box but I also see

BOX_SPECIALS_ALLPRODS

BOX_WHATSNEW_ALLPRODS

 

under the menu so I guess I do it wrong.

 

do u mind trying again?

Share this post


Link to post
Share on other sites
thank you very much for the reply.

I tried the code in the sts_column_left.php but I still get the same menu. even if I comment out the code for the regular category box I get the same category box, could that be from the cache?

this is how my code looks now

 

//Get categories box from db or cache  
if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }  
 $sts->restart_capture ('categorybox', 'box');  

// Get categories css menu box from db or cache  
 if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_categories_box();
 }
 else {

include(DIR_WS_BOXES . 'categories_css.php');
 }  
 $sts->restart_capture ('categories_cssbox', 'box');


// Get manufacturer box from db or cache

 

 

SO then I tried just this instead

include(DIR_WS_BOXES . 'categories_css.php');
 $sts->restart_capture ('categories_cssbox', 'box');

 

that gives me the CSS box but I also see

BOX_SPECIALS_ALLPRODS

BOX_WHATSNEW_ALLPRODS

 

under the menu so I guess I do it wrong.

 

do u mind trying again?

My solution works so there is no need to try it again.


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
$templatedir does not seem to work fully, at the moment I have the following templates:

sts_template.html

infobox.php.html

infobox_header.php.html

infobox_categories_header.php.html

infobox_new_products_header.php.html

infobox_shopping_cart_header.php.html

 

Essentially, the main ones are

sts_template.html

infobox.php.html

infobox_header.php.html

 

I have the following to adjust the corner images (much like the original OSC)

infobox_categories_header.php.html

infobox_new_products_header.php.html

infobox_shopping_cart_header.php.html

 

I'm trying to use $templatedir instead of includes/sts_templates/template1 for SRC of images, however it appears to only work some of the time.

 

On the index page:

 

infobox_categories_header.php.html (should be using infobox_categories_header.php.html) - Works fine

Manufacturers (should be using infobox_header.php.html) - Works fine

Quick Find (should be using infobox_header.php.html) - Does NOT work

Information (should be using infobox_header.php.html) - Works fine

New Products for Month (should be using infobox_new_products_header.php.html) - Does NOT work

Shoppnig Cart (should be using infobox_shopping_cart_header.php.html) - Does NOT work

Best Sellers (should be using infobox_header.php.html) - Works fine

 

Instead of it replacing $templatedir with includes/sts_templates/templatename I see

http://www.site.com/catalog/$templatedir/images/infobox/corner_left.gif

when it should be

http://www.site.com/catalog/includes/sts_templates/templatename/images/infobox/corner_left.gif

 

I'm also using $templatedir to point to the stylesheet, instead of the one at the catalog root, in the template and that works fine.

 

Anyone else experienced this? I'd rather use $templatedir so it's easier to make lots of templates quickly.

 

I'm having same problem with $templatedir.

Does anyone know where is the problem or bug?

Share this post


Link to post
Share on other sites

Can someone tell me where I set a fixed width for the $content? Secifically the log-in page. It nearly doubles the content area when displayed.

Edited by erikajune

Share this post


Link to post
Share on other sites
Can someone tell me where I set a fixed width for the $content? Secifically the log-in page. It nearly doubles the content area when displayed.

At about line 300 in catalog/index.php you will find something like

 

<?php

} else { // default page

?>

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

You can change width to some other percentage or to some fixed pixel size. However, people may have different display sizes, so 100% usually will accommodate most of them. It simply uses any width available. To check how it works on other display resolutions you can resize your browser window. And if you want to change your flexible site layout to some fixed size, you will have to change 100% to something else in many other places.

Edited by Syeager

Share this post


Link to post
Share on other sites
Can someone tell me where I set a fixed width for the $content? Secifically the log-in page. It nearly doubles the content area when displayed.

Create a template for the login page and then restrict the size within your template where you are using the $content tag. For example, if you are using Tables/cells, restrict the size of the table/cell in your template.


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,

 

Sorry I started a topic before I saw this thread... I must be going blind!!

 

Its a simple question really... can you use seo friendly url's with sts? Is there a contribution for it, or does the seo pack work with sts?

 

It'd be great if it can be done ..

 

Thanks alot,

Share this post


Link to post
Share on other sites
Hi,

 

Sorry I started a topic before I saw this thread... I must be going blind!!

 

Its a simple question really... can you use seo friendly url's with sts? Is there a contribution for it, or does the seo pack work with sts?

 

It'd be great if it can be done ..

 

Thanks alot,

 

Steve,

 

STS will not have any issues with adding a SEO URL contribution. Keep in mind that you cannot use the default search engine friendly URL's option in the admin as it is completely unstable with ANY contribution, including STS.


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

Greetings.

 

I have tried my best to solve this issue on my own however I am unable to come up with a solution. I am using the Fancy Lightbox Popup contrib in conjunction with STS. If I have the product info template disabled the lightbox works fine. I have have the product info template enabled, the lightbox does not function and the store returns to the default popup mechanism.

 

Any help with this issue would be appreciated. If further information is needed please, let me know. Thank you in advance.

Share this post


Link to post
Share on other sites

BUG FIX - FOR oscommerce 2.2 MS 2

 

After installing STS the admin panel > modules > sts > update

did not work. It simply was not updating. The same values remained so I could not turn sts on with the admin panel.

 

I had difficulty finding this fix (which I needed to get STS working) so I have included here.

 

The fix has been applied to oscommerce RC2. To manually apply to MS2 follow these instructions. They are from a shipping post as this fixes a number of issues:

 

Darren

Are you using the latest RC1 version of osCommerce? If not, then make the following edits to correct the "refresh" bug (this was corrected in the RC1 release):

Affected Files

catalog/includes/functions/compatibility.php

catalog/admin/includes/functions/compatibility.php

 

File: catalog/includes/functions/compatibility.php:

 

Find this:

 

[code] 

// This is due to the possibility of have an array in
// $HTTP_xxx_VARS
// Ie, products attributes
 function do_magic_quotes_gpc(&$ar) {
if (!is_array($ar)) return false;
while (list($key, $value) = each($ar)) {
  if (is_array($ar[$key])) {
	do_magic_quotes_gpc($ar[$key]);
  } else {
	$ar[$key] = addslashes($value);
  }
}
 }

 if (PHP_VERSION >= 4.1) {
$HTTP_GET_VARS =& $_GET;

Change to:

 

// This is due to the possibility of have an array in
// $HTTP_xxx_VARS
// Ie, products attributes
 function do_magic_quotes_gpc(&$ar) {
if (!is_array($ar)) return false;

reset($ar);
while (list($key, $value) = each($ar)) {
  if (is_array($ar[$key])) {
	do_magic_quotes_gpc($ar[$key]);
  } else {
	$ar[$key] = addslashes($value);
  }
}
reset($ar);
 }

 if (PHP_VERSION >= 4.1) {
$HTTP_GET_VARS =& $_GET;

File: catalog/admin/includes/functions/compatibility.php

Find this:

 

 

// This is due to the possibility of have an array in
// $HTTP_xxx_VARS
// Ie, products attributes
 function do_magic_quotes_gpc(&$ar) {
if (!is_array($ar)) return false;
while (list($key, $value) = each($ar)) {
  if (is_array($ar[$key])) {
	do_magic_quotes_gpc($ar[$key]);
  } else {
	$ar[$key] = addslashes($value);
  }
}
 }

 if (PHP_VERSION >= 4.1) {
$HTTP_GET_VARS =& $_GET;

Change to:

 

// This is due to the possibility of have an array in
// $HTTP_xxx_VARS
// Ie, products attributes
 function do_magic_quotes_gpc(&$ar) {
if (!is_array($ar)) return false;

reset($ar);
while (list($key, $value) = each($ar)) {
  if (is_array($ar[$key])) {
	do_magic_quotes_gpc($ar[$key]);
  } else {
	$ar[$key] = addslashes($value);
  }
}
reset($ar);
 }

 if (PHP_VERSION >= 4.1) {
$HTTP_GET_VARS =& $_GET;

Hope this helped,

Share this post


Link to post
Share on other sites
BUG FIX - FOR oscommerce 2.2 MS 2

 

After installing STS the admin panel > modules > sts > update

did not work. It simply was not updating. The same values remained so I could not turn sts on with the admin panel.

 

I had difficulty finding this fix (which I needed to get STS working) so I have included here.

 

The fix has been applied to oscommerce RC2. To manually apply to MS2 follow these instructions. They are from a shipping post as this fixes a number of issues:

 

Sorry, but you are way off base here and will only cause confusion....

 

There is NO bug in STS regarding the updating of the modules in the admin. Oscommerce does not have this bug either as long as you are using the most recent RC2a version. If you are using an older version of osCommerce, then yes you will experience this bug as well as many other bugs.

 

I SUGGEST THAT YOU POST THE BUG REPORT BEFORE OFFERING A SOLUTION AS THE SOLUTION MAY ALREADY EXIST THAT WILL NOT CONFLICT WITH OTHER COMPONENTS OF STS OR OSCOMMERCE.

 

The official fix for older versions of osCommerce (again, nothing to do with STS) is found here:

http://forums.oscommerce.com/index.php?sho...p;#entry1117449


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

Using STS 4.5.8 and also the Ultimate SEO URl's v21.d contributions. Have beeen using STS for over 2 years with a high degree of success.

Added USU and it was a pretty painless install. Both seem to work great together whenever a script uses the tep_href_link function to build a link. No issues, has worked fine for several months.

 

Several infoboxes I have noticed, Manufacturerbox and Catmenubox specifically, use tep_draw_form and tep_draw_pull_down_menu to build the forms containing the manufacturer and catmenu boxes to be used as links. They aren't written to the html as 'regular' links but as selects and options inside of the form. So, USU does not conveert the url to a search engine friendly url and it does for 'normal urls.

 

These functions don't include the USU seo.class.php inside the html output script as tep_href_link was modified to do. So, the selected link out of one of these boxes does not have a modified url. But contains the standard style url.

 

People that use and support USU's are pretty unanimous in stating the the url's are converted when not using STS.

 

So am wondering if this is some sort of STS issue. Did quite a bit of searching, but haven't seen anything definitive.

Share this post


Link to post
Share on other sites
Greetings.

 

I have tried my best to solve this issue on my own however I am unable to come up with a solution. I am using the Fancy Lightbox Popup contrib in conjunction with STS. If I have the product info template disabled the lightbox works fine. I have have the product info template enabled, the lightbox does not function and the store returns to the default popup mechanism.

 

Any help with this issue would be appreciated. If further information is needed please, let me know. Thank you in advance.

 

I have done more research and have found this post:

STSv4.5.8, HeaderTags 2.6.3, 'Ultra Pics 2.07.01 - incl. STS + CCGV + LightBox'.

 

Store is coming along but ran in to a problem today. I'm trying to use a content template to change the layout of the product_info content. It worked well with the exception of my extra images. How would I go about including this element in my content template?

 

Thank you!

 

You would need to modify the sts_inc/product_info.php file.

 

:thumbsup: Any contribution that modifies the stock product_info.php file would also need to make those same modifications in the sts_inc/product_info.php file ONLY if you intend to use product info content templates.

 

According to the install instructions for Fancy Lightbox Popup I opened product_info.php and added the following:

	<script type="text/javascript" src="lightbox/prototype.js"></script>
<script type="text/javascript" src="lightbox/scriptaculous.js?load=effects"></script>
<link rel="stylesheet" href="lightbox/lightbox.css" type="text/css" media="screen">
<script type="text/javascript" src="lightbox/builder.js"></script>
<script type="text/javascript" src="lightbox/lightbox.js"></script>

Following the directions provided by bkellum in the post above, I opened /includes/modules/sts_inc/product_info.php but I can not find a </head> tag.

 

Any help in this matter would be greatly appreciated. If more information is needed please, let me know. Thank you.

Share this post


Link to post
Share on other sites
I have done more research and have found this post:

 

 

Following the directions provided by bkellum in the post above, I opened /includes/modules/sts_inc/product_info.php but I can not find a </head> tag.

 

Any help in this matter would be greatly appreciated. If more information is needed please, let me know. Thank you.

 

 

Not sure what you are trying to accomplish, but if you are looking for <head> tags, you need to look in your sts_templates folder ( or whatever you have named it) for general.htm and add your changes in that program. If you have separate templates for index or product_info pages, you woould look for index_php_26.html or similiar for index pages and similiar to that for product_info pages.

 

Product_info.php does not have html code in it.

Share this post


Link to post
Share on other sites
Not sure what you are trying to accomplish, but if you are looking for <head> tags, you need to look in your sts_templates folder ( or whatever you have named it) for general.htm and add your changes in that program. If you have separate templates for index or product_info pages, you woould look for index_php_26.html or similiar for index pages and similiar to that for product_info pages.

 

Product_info.php does not have html code in it.

Thank you for the input. I am trying to get the Fancy Lightbox Popup to work with STS. If I have Product Info templates enabled for STS via the admin control panel, the lightbox does not work. If I turn off the Product Info template, the lightbox works.

Share this post


Link to post
Share on other sites

Hi, I am just getting my site sorted. http://design.mmmboptastic.com using STS. I have it using the 'test' template instead of the 'full' one as I don't understand the 'full' one enough.

 

At the bottom I want to have my links (about, faq, links, contact etc) but I don't want to use the 'information' box (I found it impossible to add pages with that function!). Is there a way of doing this? So if someone clicks on 'About' it opens store.com/about.html (or .php) which is a page that has the 'about' information where $content usually is and then the other bits like 'account' etc where theyusually are.

 

I uploaded about.php to the root http://design.mmmboptastic.com/about.php but as you can see it doesn't work how I want it to.

 

Hope you understand what I'm trying to explain.

 

Thanks

Jo :)

Edited by joannemojo

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

×