Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

HI,

I get the following error at my path to /catalog/ after a fresh install:

 

Fatal error: Failed opening required 'STS_START_CAPTURE' (include_path='.:/usr/local/lib/php') in /homepages/41/d88276381/htdocs/webmasteroutlet.com/catalog/includes/application_top.php on line 511

 

How do I fix this? Did I do somethin wrong? Please help! Thanks!

Share this post


Link to post
Share on other sites
HI,

I get the following error at my path to /catalog/ after a fresh install:

 

Fatal error: Failed opening required 'STS_START_CAPTURE' (include_path='.:/usr/local/lib/php') in /homepages/41/d88276381/htdocs/webmasteroutlet.com/catalog/includes/application_top.php on line 511

 

How do I fix this?  Did I do somethin wrong?  Please help!  Thanks!

You didn't copy the defines for STS from the bottom of the configure-SAMPLE.php file to your production configure.php.

 

- 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

Simple Template System (STS) v2.00 Released

 

STS version 2.00 has been released. It has some great new features:

 

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

NEW IN STS VERSION 2.00

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

 

PRODUCT_INFO TEMPLATES: You can customize your product information pages by creating /catalog/includes/sts_templates/product_info.php.html and using the product_info template variables (listed below) to layout your product_info

pages.

 

MULTIPLE CATEGORY TEMPLATES: Create custom templates for any or each category:

 

1) You can have a default site template by creating

creating /catalog/includes/sts_template.html

 

2) You can have a default category template by

creating /catalog/includes/sts_templates/index.php.html

 

3) You can have a different template for the Main Catalog Page (cPath=0) by

creating /catalog/includes/sts_templates/index.php_0.html

 

4) You can have a different template for the other Catalog pages (cPath=XX_YY)

by creating /catalog/includes/sts_templates/index.php_XX-YY.html (where XX_YY

is the cPath=XX_YY value you see in the categories URL

 

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

USING MULTIPLE CATEGORY TEMPLATES:

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

Starting with version 2.00 you can now use multiple template files that will

change according to the category selected in index.php.

 

You can now create custom templates for any or each category. Here is how

the appropriate template file is selected:

 

1) You can have a default site template by creating

 

/catalog/includes/sts_template.html

 

2) You can have a default category template by creating

 

/catalog/includes/sts_templates/index.php.html

 

3) You can have a different template for the Main Catalog Page (cPath=0) by

creating

 

/catalog/includes/sts_templates/index.php_0.html

 

4) You can have a different template for the other Catalog pages (cPath=XX_YY)

by creating

 

/catalog/includes/sts_templates/index.php_XX-YY.html

 

(where XX_YY is the cPath=XX_YY value you see in the categories URL.

 

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

USING PRODUCT_INFO CONTENT TEMPLATES:

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

Starting with version 2.00 you can now use PRODUCT_INFO TEMPLATES to customize

the $CONTENT section of your product information pages by creating:

 

/catalog/includes/sts_templates/product_info.php.html

 

and using the product_info template variables (listed below) to layout

your product_info pages.

 

A very ugly but functional sample of a product_info.php.html file is provided

in the STS distribution. This file is called:

 

product_info.php.html-SAMPLE

 

To use this file on your site, you would copy it into your

 

/catalog/includes/sts_templates/

 

directory and rename it to be

 

product_info.php.html

 

 

STS V2.00 CHANGELOG:

 

v2.00

ADD: Product_info Templates to manage $content area. New file: sts_product_info.php

ADD: Templates by Category in "index.php_CPATH.html" style, where CPATH is the cPath value (cPath=0 for Catalog Home Page). Thanks to Philip and Chris Langtiw for the idea!

FIX: tep_draw_form() call in sts_user_code - Thanks to Charlie Welf!

CHG: README.txt to include new information

UPG: To upgrade from v1.9, replace: sts_user_code.php, sts_display_output.php, add sts_product_info.php, add new DEFINE for STS_PRODUCT_INFO to configure.php

 

 

Hopefully you will find this as useful as I think you will. It makes customizing OSC even easier to help you tailor your site to look just the way you want it to.

 

I've been working on this all day, and it's about 5:00 AM right now, so there may be some bugs in it I haven't found with my testing. (This is a "dot-oh" release, after all!)

 

If you haven't yet, sign up for the STS mailing list to be kept informed of new developments without having to read this list every day! You can find the link on the STS FAQ page listed in my signature.

 

Cheers!

 

- Brian Gallagher


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

Chris,

 

do I understand this right? I can now change the "magic"?

 

Greetings, Michael


Not because it is difficult we don't dare to do it, but because we don't dare to do it, it is difficult. (Seneca)

Share this post


Link to post
Share on other sites
cool

 

What is the go for upgrading from 1.9?  Do I just need to replace the sts_***.php files with the new ones?

Here's the CHANGELOG.txt I forgot to post. Sorry! Look at the UPG: lines:

 

v2.01

FIX: Copyright notices

UPG: No functional changes, replace all files to update copyright notices in code to osC standards.

 

v2.00

ADD: Product_info Templates to manage $content area. New file: sts_product_info.php

ADD: Templates by Category in "index.php_CPATH.html" style, where CPATH is the cPath value (cPath=0 for Catalog Home Page). Thanks to Philip and Chris Langtiw for the idea!

FIX: tep_draw_form() call in sts_user_code - Thanks to Charlie Welf!

CHG: README.txt to include new information

UPG: To upgrade from v1.9, replace: sts_user_code.php, sts_display_output.php, add sts_product_info.php, add new DEFINE for STS_PRODUCT_INFO to configure.php

 

- 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

Great Job as usual :D can't wait to get this installed and use it on my next site! thanks again Brian

 

charlie :D

Edited by babeskidoodle

Share this post


Link to post
Share on other sites

1. What would be the easiest way to modify the look of the info boxes in my store? I know there is a contribution that will do it. Could I also get rid of all the pics and CSS around my boxes so it's just the data inside and then place it in a table in my sts_template.html file with my homemade graphics around it? Basically I'd be making my own skins and placing the main infobox data inside.

 

2. Another question about modifying the product decription page. I want to enlarge the picture of the product, place it on the left side instead of the right, and place the "add to cart" button in a different location. I know I can add html to the product desc. in the database to do similar things but is there a better way? Also, if I change the size of the product picture using the Admin, then it changes the size of the pic everywhere. I just want a big pic on the product desc. page.

Share this post


Link to post
Share on other sites

Whoops, sorry guys. I should have read the posts above mine! Thanks Diamond Sea for quickly implementing the templates for every category page in the new version 2.0. I also see that I can now modify my product_info pages! This STS is turning into a really amazing contrinution. I'm trying to build a store with the look of an Amazon.com and STS is making it possible. I'll make sure to post any other suggestions as I continue modifying my OSC store.

 

Now about modifying those infoboxes...any suggestions?

Share this post


Link to post
Share on other sites
Now about modifying those infoboxes...any suggestions?

well right or wrong this is how I did it. Lets say you want to build a best sellers box. build the box the way you wanted it in your sts template with all the colors, graphic, borders, etc. then were you want the data to go put in the $bestsellersbox. Now edit includes/boxes/best_sellers.php and comment out the following code:

 

new infoBoxHeading($info_box_contents, false, false);

 

and volia, all you have is the box contents in the $bestsellersbox, no heading, no borders, no background colors, just the data.

 

Of course this makes life a little more difficult if you want to upgrade in the future :blink: but I'm willing to accept that.

 

Anyone have any other ideas that would be easier or not effect the core files?

 

Thanks

Charlie

Edited by babeskidoodle

Share this post


Link to post
Share on other sites
1.  What would be the easiest way to modify the look of the info boxes in my store? I know there is a contribution that will do it.  Could I also get rid of all the pics and CSS around my boxes so it's just the data inside and then place it in a table in my sts_template.html file with my homemade graphics around it?  Basically I'd be making my own skins and placing the main infobox data inside.

 

I'll leave this to some of the others to answer. My brain is way fried, running on 1.5hrs sleep after writing the new version.

 

2. Another question about modifying the product decription page.  I want to enlarge the picture of the product, place it on the left side instead of the right, and place the "add to cart" button in a different location.  I know I can add html to the product desc. in the database to do similar things but is there a better way?  Also, if I change the size of the product picture using the Admin, then it changes the size of the pic everywhere.  I just want a big pic on the product desc. page.

 

Copy your /catalog/includes/sts_template.html to /catalog/includes/sts_templates/product_info.php.html

 

Edit the new product_info.php.html file you just created and remove the $content tag from the main area.

 

Where the $content tag was, put something like this:

 

$startform
$productname<br>
$productdesc<br>
$productmodel<br>
$imagelarge<br>
$regularprice<br>
$specialprice<br>

$optionheader<br>
<table border=1><tr><td>Option Names:</td><td>Option Choices</td></tr>
<tr><td>
$optionnames
</td><td>
$optionchoices
</tr></table>

<a href=$moreinfourl>$moreinfolabel</a><br>
$productdatelabel $productdate<br>
$reviews<br><a href=$reviewsurl>$reviewsbutton</a><br>
<image type=image src=$addtocartbutton><br>

$endform

 

This is off the top of my head so it may not work perfectly, but it should give you the general idea.

 

Once you have this working, then you can go in and format to look however you want by simply moving the tags around.

 

- 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

thank you thank you thank you brian! the latest version of STS is awesome!! it has solved many many of my problems i have been mulling over the past few days all at once! i'm almost done with my store! will post my store when i'm done.

 

thanks again! great work!

Share this post


Link to post
Share on other sites

Brian G. (Diamond Sea), get some rest please! You deserve it. In the meantime, I'll be tooling around with all the new stuff in v2.0. I've been working with the product_info.php template for the last few hours on my site and I have a little obstacle.

 

Problem: Every product I sell has a short 1 paragraph description about the product and then a in-depth explanation about how to use the product that may require several paragraphs. I want the $addtocartbutton and prices to appear after the small description and before the in-depth description. Like this:

 

$startform

$productname<br/>

$productdesc<br/> //Short product description, about 1 paragraph)

$regularprice<br/>

$addtocartbutton

Full in-depth product desc. (several paragraphs) goes here, after $addtocartbutton

$endform

 

Now, I can enter the entire desc (short and in-depth) in the desc fields in the OSC Admin. However, STS doesn't recognize any commands in the $productdesc data, so I couldn't just add the defined $addtocartbutton in the $productdesc data. Also, I could make a template for every product I have so I could just add the in-depth info on each page. However, this would be tedious and dirty.

 

Is there some way for STS to read it's own defined variables if placed in the $productdesc data? How else could I possiblly place the add to cart button in the middle of a desc. like I want to? Float it using css? Any ideas?

Share this post


Link to post
Share on other sites

Just another quick ?: how would I add a "Enter quantity" field right above the "add to cart" button so the customer could enter the quantity of product they want before buying?

Share this post


Link to post
Share on other sites

Ok I hope I'm not posting too much here ;-). There is one flaw I think with using the new product_info templates. Suppose I already have a template for a category, and on that template there is a tab with the category name and it's highlighted in a color to show the category is active. Using just the category template feature this would allow that tab to be highlighted as long as the customer is looking at any products under that cat.

 

However, if I use a product_info template, then there is no way currently for that product_info template to know what category it's under, so that it can keep the tab activated and colored. So this seems to work against the category template feature.

 

A possible solution would be to add the ability to have multiple product_info templates (1 per category) as well, so that you could then design each product_info template to match the cat template that it would fall under. Make sense? This would keep the cat template the same even when browsing products. There may be other solutions as well.

Share this post


Link to post
Share on other sites

Hi,

 

the PRODUCT_INFO CONTENT TEMPLATES is not working on my Windows Me system (only for testing). The reason ist, that the function

 

getenv('SCRIPT_NAME') ; return the string: /php/php.exe

, but the function

getenv('PATH_INFO'); returns the correct string: /catalog/product_info.php

 

so I have to replace

$scriptname = getenv('SCRIPT_NAME');

with

$scriptname = getenv('PATH_INFO');

 

in the sts_display_ouput.php - file

 

Bye

Andreas

Share this post


Link to post
Share on other sites

Just download the newest OSC then installed. Tested and worked as advertised.

 

Then I download the STS Template System and installed using METHOD

-----------------------------------------------------------------------------
HOW TO INSTALL (EASY):
-----------------------------------------------------------------------------

Install a clean version of the osCommerce Milestone 2.2 Release (OSC 2.2MS2),
run the install program and verify that everything works.  (If you have 
already added other contributions, it may not work the Easy way and 
you may have to use the Advanced method.

Then copy the following files into your /catalog/includes directory.

application_top.php
header.php
column_left.php
column_right.php
footer.php
application_bottom.php
sts_start_capture.php
sts_stop_capture.php
sts_restart_capture.php
sts_display_output.php
sts_user_code.php
sts_template.html
configure-SAMPLE.php  <----- See note below! <---------


NOTE: configure-SAMPLE.php is included in the ZIP file, but you will have to
reenter all your configuration settings if you use it.  It is easier
to just add the STS lines at the bottom of the file to the bottom of your 
existing /catalog/includes/configure.php file.

Add these lines to your /catalog/includes/configure.php script.  These lines 
should go before the final line with the ?> characters on it.

// STS: ADD: Define Simple Template System files
 define('STS_START_CAPTURE', DIR_WS_INCLUDES . 'sts_start_capture.php');
 define('STS_STOP_CAPTURE', DIR_WS_INCLUDES . 'sts_stop_capture.php'); 
 define('STS_RESTART_CAPTURE', DIR_WS_INCLUDES . 'sts_restart_capture.php');
 define('STS_TEMPLATE_DIR', DIR_WS_INCLUDES . 'sts_templates/');
 define('STS_DEFAULT_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html'); 
 define('STS_DISPLAY_OUTPUT', DIR_WS_INCLUDES . 'sts_display_output.php');
 define('STS_USER_CODE', DIR_WS_INCLUDES . 'sts_user_code.php');
 define('STS_PRODUCT_INFO', DIR_WS_INCLUDES . 'sts_product_info.php');
// STS: EOADD

 

And now I get this error:

Fatal error: Cannot instantiate non-existent class: currencies in /home/joanw/public_html/catalog/includes/application_top.php on line 258

 

complaining about currencies

 

-Al

Share this post


Link to post
Share on other sites

Hi. I`ve made an new Site and a new Link in the header instead of an picture in the head. If i click the link in the head the content in the middle changes. Thats work fine. But know I must also change something on the content_left side if i click the link. For example:

In the head stands 2 Links. One calls the page called "A" and the other called th page called "B". If Link "A" is pressed the content must change to "A" (that works at the moment) and also on the left side must a box displayed with a subnaviagtion releated to Link A.

And if Link "B" is pressed the same should happen. But not Content A und Subnavibox A must displayed instead of this must Content B and Subnavibox B displayed. How i Could relize the changing of the Subnavixboxex A and B in relation of what Link is presses in the Header Navigation: Sorry for the bad English. Nice contribution...

 

Greeting freom Germany.

 

Jan Entzminger

Share this post


Link to post
Share on other sites

Ok I'm trying to understand what you just said. So you have a header on every page that has 2 links, 1 link goes to a page displaying content "A" with an A-related navigation box on the side, and the other link jumps to a page displaying "B" content with a B-related naviagtion box displaying on the side.

 

Make a template for your main page with the header you want, then make the 2 links in the page header jump to 2 category templates, 1 for content A material and one for content B material. Using the category templates you should be able to put a navigation box on the side of the page like you want.

Share this post


Link to post
Share on other sites

I need help! I just installed STS over a fresh os and I'm getting this error

 

1046 - No Database Selected

 

select configuration_key as cfgKey, configuration_value as cfgValue from configuration

 

[TEP STOP]

 

Any clue as to what is wrong?

 

Thanks!

Share this post


Link to post
Share on other sites

Well I just started over and now I'm getting this with version 2:

 

Template file doesn't exist: [sTS_DEFAULT_TEMPLATE]

Warning: fopen(STS_DEFAULT_TEMPLATE): failed to open stream: No such file or directory in /home/doodleb/public_html/store/includes/sts_display_output.php on line 120

Can't open Template file: [sTS_DEFAULT_TEMPLATE]

Warning: filesize(): Stat failed for STS_DEFAULT_TEMPLATE (errno=2 - No such file or directory) in /home/doodleb/public_html/store/includes/sts_display_output.php on line 124

 

Warning: fread(): supplied argument is not a valid stream resource in /home/doodleb/public_html/store/includes/sts_display_output.php on line 124

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/doodleb/public_html/store/includes/sts_display_output.php on line 125

 

Warning: main(STS_USER_CODE): failed to open stream: No such file or directory in /home/doodleb/public_html/store/includes/sts_display_output.php on line 138

 

Fatal error: main(): Failed opening required 'STS_USER_CODE' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/doodleb/public_html/store/includes/sts_display_output.php on line 138

Share this post


Link to post
Share on other sites

Ok I have a problem after I installed STS my checkout proccess doesn't work correctly for example people put in the credit card number and click confirm it takes them back to entering thier credit card number in again(I use

Authorize.net Module). Another problem is I have a proceed directly to checkout option and now when it is clicked it just gives a mostly blank page. Is there anyway to disable STS from configuring certain pages like my checkout proccess? I tried just puting sts_template=0 in the url but it didn't work. My store is not live yet so you can see for yourself at OhioPc

Share this post


Link to post
Share on other sites

Hello oph32ez4,

i have excactly the same problem,

also installed sts and pwa 0.70 for logging in without account I got excactley the same:

1-checkout proccess doesn't work correctly for example people put in the credit card number and click confirm it takes them back to entering thier credit card number in again

2 proceed directly to checkout option and now when it is clicked it just gives a mostly blank page

 

Also do not know how to handle this...


Keesjan

Share this post


Link to post
Share on other sites
Well I just started over and now I'm getting this with version 2:

 

Template file doesn't exist: [sTS_DEFAULT_TEMPLATE]

Warning: fopen(STS_DEFAULT_TEMPLATE): failed to open stream: No such file or directory in /home/doodleb/public_html/store/includes/sts_display_output.php on line 120

Can't open Template file: [sTS_DEFAULT_TEMPLATE]

Warning: filesize(): Stat failed for STS_DEFAULT_TEMPLATE (errno=2 - No such file or directory) in /home/doodleb/public_html/store/includes/sts_display_output.php on line 124

 

....etc.

Lost Child,

 

Make sure that you have added the correct lines to the end of your catalog/includes/configure.php file and that they are still there:

 

// STS: ADD: Define Simple Template System files

define('STS_START_CAPTURE', DIR_WS_INCLUDES . 'sts_start_capture.php');

define('STS_STOP_CAPTURE', DIR_WS_INCLUDES . 'sts_stop_capture.php');

define('STS_RESTART_CAPTURE', DIR_WS_INCLUDES . 'sts_restart_capture.php');

define('STS_TEMPLATE_DIR', DIR_WS_INCLUDES . 'sts_templates/');

define('STS_DEFAULT_TEMPLATE', DIR_WS_INCLUDES . 'sts_template.html');

define('STS_DISPLAY_OUTPUT', DIR_WS_INCLUDES . 'sts_display_output.php');

define('STS_USER_CODE', DIR_WS_INCLUDES . 'sts_user_code.php');

define('STS_PRODUCT_INFO', DIR_WS_INCLUDES . 'sts_product_info.php');

// STS: EOADD

 

I had the same error and noticed that somehow these lines got erased in my configure.php file.

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

×