Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Brian,

 

Thanks for the update. It looks like you have added some great new functionality. Having the errors and warnings show on the page will be very helpful.

 

Keep up the good work!

 

Eric Stamper

Share this post


Link to post
Share on other sites

Brian,

 

I've approached this contribution with great enthusiasm as I have been wanting to create shops which don't look like out of the box OSC, but love the cart and everything about the community. I have done the installation but get the following error messages:

 

Warning: main(includes/sts_user_code.php): failed to open stream: No such file or directory in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 82

 

Fatal error: main(): Failed opening required 'includes/sts_user_code.php' (include_path='.:/usr/local/lib/php/') in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 82

 

Do I need to install WebMakers.com Changed: Header Tag Controller v1.0?

 

I have the latest MS2 version which was working perfectly. Should it have the header tag controller built into it? Or do I need to install Linda's hearder tag controller. Any advice would be helpful.

 

thanks,

Murray

Share this post


Link to post
Share on other sites

Would it be possible to have a html template for each respective php file, for example, index.html, contact_us.html etc?


"Any fool can know. The point is to understand." -- Albert Einstein

Share this post


Link to post
Share on other sites
I've approached this contribution with great enthusiasm as I have been wanting to create shops which don't look like out of the box OSC, but love the cart and everything about the community. I have done the installation but get the following error messages:

 

Warning: main(includes/sts_user_code.php): failed to open stream: No such file or directory in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 82

 

Fatal error: main(): Failed opening required 'includes/sts_user_code.php' (include_path='.:/usr/local/lib/php/') in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 82

 

Do I need to install WebMakers.com Changed: Header Tag Controller v1.0?

 

I have the latest MS2 version which was working perfectly. Should it have the header tag controller built into it? Or do I need to install Linda's hearder tag controller. Any advice would be helpful.

 

Make sure there is no space or hard return at the end of the file in 'includes/sts_user_code.php'

 

This seems to cause this error.

Share this post


Link to post
Share on other sites

When using STS to alter the default template have I got complete freedom when it comes to graphical content?

What I mean is can I remove the OS commerce logo, add my own plus additional graphics in the navigation bar. If so do I reference the images using http://pathtoimages or relative paths?

 

Also is the table created to hold that actual page details a fixed width or will it fot within the design widths I use?

 

Many thanks

Share this post


Link to post
Share on other sites

Vaiso,

 

When using STS to alter the default template have I got complete freedom when it comes to graphical content?

What I mean is can I remove the OS commerce logo, add my own plus additional graphics in the navigation bar. If so do I reference the images using http://pathtoimages or relative paths?

 

You can plug in additional graphics to the template page. You should be able to use either full paths or relative paths for this. By default, in the $headercontent template variable there is a reference to the base address to your page. This will allow the use of relative url's.

 

 

Also is the table created to hold that actual page details a fixed width or will it fot within the design widths I use?

 

The table widths are controlled in the sts_template.html file. For example around line 27 you would see this code:

 

 <td width="125" valign="top">

 

You could change the default value of 125 pixels to whatever you want. This would change the width of the left column. The main content section, the right column, and any other parts of the page could be conrolled similarly.

 

 

Eric Stamper

Share this post


Link to post
Share on other sites
When using STS to alter the default template have I got complete freedom when it comes to graphical content?

What I mean is can I remove the OS commerce logo, add my own plus additional graphics in the navigation bar. If so do I reference the images using http://pathtoimages or relative paths?

 

You can plug in additional graphics to the template page.  You should be able to use either full paths or relative paths for this.  By default, in the $headercontent template variable there is a reference to the base address to your page.  This will allow the use of relative url's.

 

You have complete freedom to lay out your page however you like. The sts_template.html included with the package is just a sample that looks like the default OSC catalog so people can get familiar with what all the $variables do.

 

I recommend using absolute URL's (starting with just a slash or http://) for your stylesheet and image links. This will make it easier to debug your output, because you will be able to simply point your browser to http://yourdomain.com/catalog/includes/sts_template.html and see what it will look like, showing the $variables in their places.

 

It will work with relative links, but you won't be able to preview your page the same way.

 

Also is the table created to hold that actual page details a fixed width or will it fot within the design widths I use?

 

The page contents in the $contents variable are enclosed in a table with a width of 100%, so it should automatically scale to whatever you have it in.

 

The table widths are controlled in the sts_template.html file.  For example around line 27 you would see this code:

 

 

 <td width="125" valign="top">

 

You could change the default value of 125 pixels to whatever you want. This would change the width of the left column.  The main content section, the right column, and any other parts of the page could be conrolled similarly.

 

FYI, the various boxes are set up with width=100%, so they will become wider to suit the size of the table cell that they are contained in. So if you make the column_left table width=250, all the boxes will become twice as wide. This can be handy when working with long category names or deeply nested categories (but you should avoid having either of those as a usability issue).

 

Additionally, you can get rid of the $categorybox altogether and use an image map or other links for your navigation system if you want by using the <a href="$cat_XXX"> technique (in v1.5+) to link directly to a category page without having to use the $categorybox control.

 

What you get your design up, post a link to the site and the template page so other people can see how it works.

 

Thanks!

 

- Brian


Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites

I installed Simple Template System and now the <html>, <head>, etc. tags are showing up twice.

 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mysite</title><base href="http://www.mysite.com/">

<!-- start get_javascript(applicationtop2header) //-->
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mysite</title>
<base href="http://www.mysite.com/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->

<!-- end get_javascript(applicationtop2header) //-->

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

Share this post


Link to post
Share on other sites

Thanks, Brian, for sharing all your hard work and providing this contribution. The master template system is an ingenious way to allow considerable layout/design flexibility without requiring changes to the core program files.

 

We have all spent countless hours trying to customize our own storefronts by changing the code -- usually with considerable frustration and complications. Your contribution has simplified this process immensely (particularly for Dreamweaver template users!) and without any apparent performance slowdowns. It also provides endless possibilities for displaying other types of infobox creations from customized template variables.

 

Thanks again. Your efforts are greatly appreciated!

Share this post


Link to post
Share on other sites

re:Make sure there is no space or hard return at the end of the file in 'includes/sts_user_code.php'

 

This seems to cause this error.

I made sure that the "sts_user_code.php" had no extra lines or carriage returns.

I now get a new error message.

 

Warning: main(includes/functions/clean_html_comments.php): failed to open stream: No such file or directory in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 99

 

Fatal error: main(): Failed opening required 'includes/functions/clean_html_comments.php' (include_path='.:/usr/local/lib/php/') in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 99

 

I suppose moving up 17 lines in the code is progress but there is still a major problem. I am using v1.5 and trying to install into a Version which is clean except for Ajeh's Shop Enhancement Controller (SEC for MS2)

 

I really love the idea of this contribution and would love to be able to customize the look and feel the way it promises. Any idea what could be wrong?

thanks,

Share this post


Link to post
Share on other sites

Hi i installed the latest version,

 

but because i dont have my apache, php etc installed on c: but on D: it gets the error cant open c:\php\pear

 

how do i reasolve it i searched though the files fot the path but could not find it :(

Share this post


Link to post
Share on other sites
but because i dont have my apache, php etc installed on c: but on D: it gets the error cant open c:\php\pear

 

how do i reasolve it i searched though the files fot the path but could not find it :(

I would expect that to be in the include_path variable in your php.ini file, which is probably in something like (exact path depends on your system) c:\windows\system32\php.ini

 

Hth,

Matt

Share this post


Link to post
Share on other sites

This is a brilliant contribution! I am now enjoying what used to be the most dreaded part of osC - layout and design. STS is elegantly simple and allows endless possibilities. Thank you very much Brian!

 

David

Share this post


Link to post
Share on other sites
but because i dont have my apache, php etc installed on c: but on D: it gets the error cant open c:\php\pear

 

how do i reasolve it i searched though the files fot the path but could not find it :(

I would expect that to be in the include_path variable in your php.ini file, which is probably in something like (exact path depends on your system) c:\windows\system32\php.ini

 

Hth,

Matt

well it works without the STS script so i think it has to be a setting in one of the files i replaced right? so in one of the script files

Edited by GReeToZ

Share this post


Link to post
Share on other sites
My apologies, I ommitted a the code that adds it to the template. The sts_user_code.php commented out code should have read like this:

Hey, thanks! That did the trick!

Share this post


Link to post
Share on other sites
I installed Simple Template System and now the <html>, <head>, etc. tags are showing up twice.

 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mysite</title><base href="http://www.mysite.com/">

<!-- start get_javascript(applicationtop2header) //-->
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mysite</title>
<base href="http://www.mysite.com/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->

<!-- end get_javascript(applicationtop2header) //-->

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

If you have an old version, install the new one that fixes it. I think this was fixed in v1.3, current version is 1.4.

 

- Brian


Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites
I installed Simple Template System and now the <html>, <head>, etc. tags are showing up twice.

 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mysite</title><base href="http://www.mysite.com/">

<!-- start get_javascript(applicationtop2header) //-->
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mysite</title>
<base href="http://www.mysite.com/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->

<!-- end get_javascript(applicationtop2header) //-->

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

If you have an old version, install the new one that fixes it. I think this was fixed in v1.3, current version is 1.4.

 

- Brian


Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites
well it works without the STS script so i think it has to be a setting in one of the files i replaced right? so in one of the script files

Did you check the paths in /catalog/includes/configure.php and make sure that they match your system's setup?

 

Unfortunately, I've only tried STS on apache so far....

 

- Brian


Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites
re:Make sure there is no space or hard return at the end of the file in 'includes/sts_user_code.php'

 

This seems to cause this error.

I made sure that the "sts_user_code.php" had no extra lines or carriage returns.

I now get a new error message.

 

Warning: main(includes/functions/clean_html_comments.php): failed to open stream: No such file or directory in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 99

 

Fatal error: main(): Failed opening required 'includes/functions/clean_html_comments.php' (include_path='.:/usr/local/lib/php/') in /www1/guatemalafairtrade.com/html/catalog/includes/sts_display_output.php on line 99

 

I suppose moving up 17 lines in the code is progress but there is still a major problem. I am using v1.5 and trying to install into a Version which is clean except for Ajeh's Shop Enhancement Controller (SEC for MS2)

 

I really love the idea of this contribution and would love to be able to customize the look and feel the way it promises.  Any idea what could be wrong?

thanks,

I haven't worked with the SEC contrib yet, so I don't have any first-hand knowledge.

 

I suspect from the error messages that SEC modified one or more of the files that STS replaces, and when you copy the STS files you clobber the SEC's code, causing all sorts of unusual behavior and cryptic error messages.

 

The best course of action would probably be to copy and paste the changes that STS made to those files (app_top, header, col_left, col_right, footer & app_bottom) into the SEC's versions of those files.

 

The update is very simple, involving just a few lines of code at the top and bottom of each of the files, and a block of code above and below each box definition in col_left and col_right.

 

Unfortunately, I'm swamped and don't have time to play with Linda's SEC and figure it out any more than this right now. :(

 

Hope this helps!

 

- Brian


Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites
I installed Simple Template System and now the <html>, <head>, etc. tags are showing up twice.

 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mysite</title><base href="http://www.mysite.com/">

<!-- start get_javascript(applicationtop2header) //-->
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>mysite</title>
<base href="http://www.mysite.com/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->

<!-- end get_javascript(applicationtop2header) //-->

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

If you have an old version, install the new one that fixes it. I think this was fixed in v1.3, current version is 1.4.

 

- Brian

Actually, I have v1.5 with this problem.

Share this post


Link to post
Share on other sites
This is a brilliant contribution! I am now enjoying what used to be the most dreaded part of osC - layout and design. STS is elegantly simple and allows endless possibilities. Thank you very much Brian!

 

David

Glad you like it!

 

Please post some links to your template files and the sites that they run on so people can see what has been done with it.

 

Please try to use Image and Stylesheet URL's that start with a leading slash, which will make the templates easier to view "raw".

 

There's lots of questions for samples of STS in action, so it would be helpful for everybody.

 

- Brian


Simple Template System (STS)

Layout your site with 1 (or more) HTML file!

Download STS: http://www.oscommerce.com/community/contributions,1524

Support: http://forums.oscommerce.com/index.php?showtopic=58541

Share this post


Link to post
Share on other sites

Warning: main(includes/configure.php): failed to open stream: No such file or directory in d:\apache\htdocs\includes\application_top.php on line 29

Fatal error: main(): Failed opening required 'includes/configure.php' (include_path='D:\apache\php\pear') in d:\apache\htdocs\includes\application_top.php on line 29

 

i get this error and the path in php.ini is correct...what am i doing wrong?

Share this post


Link to post
Share on other sites

Hi great contrib !!!

But I've found an error :-(

------------

1146 - Table 'Store.TABLE_COUPONS' doesn't exist

 

select * from TABLE_COUPONS where coupon_id = 'NEW_SIGNUP_DISCOUNT_COUPON'

 

[TEP STOP]

------------

When I try to register as a new member....

 

I think it is because of the coupn contrib but I'm not sure... Is it possible that you check it out ?

 

Many, many thanks in advance.

 

P.

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

×