Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Thank you Brian, I love, love, love your template system.

 

I am such a newbie, that it took me two days to figure out that I downloaded the wrong version of OScommerce. I downloaded the Windows version, cause that's what I have on my computer. Duh! my server is Unix! I might write an installation guide. "How to install OSc, The Dumb Blond Version"

 

The one thing I did not like is the single product image. If you load the image to the pop-up size, they are too large for the tumb-nail size. (too slow)

 

Spent the last 2 weeks trying to figure a way to add multiple images to the template. I tried Extra_images1.3, Dynamic MoPics_v3.000, and a few other ideas of my own, with no sucess. Not enough knowledge of PHP. The database part, I understand. The php part is pretty scarry. But html, is an old friend.

Finally, decided to try adding my eBay template right into the product description window in Admin.

 

Yeh! It worked. Was so simple, and easy. I have an html page for every item in my eBay store allready made. Just a matter of tweeking, till it fit my catalog product template page. No need to play with the images, they are already sized and compressed for dial-up customers. And all my regular product images that live in the database, are loaded to the thum-nail size (much faster loading)

 

I am doing the happy dance. I get to have my cake (sts) and eat it too (multiple images)

Please check out my first sucsefull product page using your wonderful sts template system:

My multipe image product template page

Liana

Share this post


Link to post
Share on other sites
Look at this post:

 

http://forums.oscommerce.com/index.php?sho...=204381&st=160#

 

and the next one for a template depending on language.

 

- Rigadin

 

This looks like exactly what i want to do. I can't seem to get it working though. i put this code into the sts_template.html file in my test folder:

 

<?php

Global $languages_id;

include (STS_TEMPLATE_DIR.'template_'.$languages_id.'.html');

?>

 

so what exactly should i name the 2 files that i want it to decide to open and where should i put them, also in the test folder? thanks,

 

Robert

Edited by sackling

Share this post


Link to post
Share on other sites
This looks like exactly what i want to do. I can't seem to get it working though. i put this code into the sts_template.html file in my test folder:

 

<?php

Global $languages_id;

include (STS_TEMPLATE_DIR.'template_'.$languages_id.'.html');

?>

 

so what exactly should i name the 2 files that i want it to decide to open and where should i put them, also in the test folder? thanks,

 

Robert

 

I changed over to the full version of sts so i doubt i would be putting the 2 seperate template files in test folder but i still dont know where to put them and what they should be called. also after adding that code i get this error when accessing the cart:

 

Warning: main(includes/sts_templates/full/template_4.html): failed to open stream: No such file or directory in /home/content/g/o/s/gostwear/html/catalog/includes/sts_templates/full/sts_template.html on line 5

 

Warning: main(includes/sts_templates/full/template_4.html): failed to open stream: No such file or directory in /home/content/g/o/s/gostwear/html/catalog/includes/sts_templates/full/sts_template.html on line 5

 

Warning: main(): Failed opening 'includes/sts_templates/full/template_4.html' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/g/o/s/gostwear/html/catalog/includes/sts_templates/full/sts_template.html on line 5

Share this post


Link to post
Share on other sites

ok im stupid, it says to take out all the code in sts_template.html and replace it with

<?php

Global $languages_id;

include (STS_TEMPLATE_DIR.'template_'.$languages_id.'.html');

?>

 

so i did that. I also made 2 files with the previous sts_template.html code in them. one for french and one for english. i named them template_1.html and template_2.html respectively and uploaded them into the full folder. this still isnt working, im getting this error which talks about template_4.html and i have no idea where that comes from since i made no such file:

 

Warning: main(includes/sts_templates/full/template_4.html): failed to open stream: No such file or directory in /home/content/g/o/s/gostwear/html/catalog/includes/sts_templates/full/sts_template.html on line 3

 

Warning: main(includes/sts_templates/full/template_4.html): failed to open stream: No such file or directory in /home/content/g/o/s/gostwear/html/catalog/includes/sts_templates/full/sts_template.html on line 3

 

Warning: main(): Failed opening 'includes/sts_templates/full/template_4.html' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/g/o/s/gostwear/html/catalog/includes/sts_templates/full/sts_template.html on line 3

Share this post


Link to post
Share on other sites

I got it working! sorry for being a nag i figured out what i was doing wrong. thanks for your advice its truly appreciated. Thanks again,

 

Robert

Share this post


Link to post
Share on other sites

what would be the tags for more pics 6? I cannot seem to get them to work - I've tried subimage1, image1 etc to no avail.


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
Share on other sites

Hi

 

I hope this will be an easy one for you. I want to update the text on the front page of the site. The bit where it says "Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account?". i need to add a bit of text below that.

 

I thought that this would be updatable in includes\languages\english\index.php but when i look there it's still got the old default text "This is a default setup of the osCommerce project, products shown are for demonstrational purposes....etc..etc...". Because of this i assume that the text must be defined somewhere else. Any idea where?

Share this post


Link to post
Share on other sites

Can anyone tell me how I can alter the page which is displayed when you enter a section or sub-section using STS 4, say Graphics cards? i want to alter how it displays the items in that section, but the file it uses is index.php?cPath=1_4

 

If I create a file called index.php_1_4.html or however you do the extensions, it doesn't use this template? instead it shows me what I have set as the default template?

 

How can I do this, I have all other pages altered i.e. front page, product page, checkout etc... using STS v4 but I can't alter the category or sub category section pages because they are a version of index.php

 

could somebody please exaplain what I am doing wrong?

 

Regards

 

Daniel Coates

Share this post


Link to post
Share on other sites

Hi I edited my index.php.html file. I couldnt get a handle on editing the languages/.../index.php to change the center content so I just deleted the $content command and went about my business. Now that I am all done I realize that I would like to add the

"Welcome Guest Would you like to log yourself in? Or would you prefer to create an account?"

and the "New for the month of xxxxxx" table.

 

I have searched to try and find how to do this but the code is to complex for me to get anything from. Does anyone have any tips on how I could do this?

 

Thanks

Share this post


Link to post
Share on other sites

Infobox Templates for STS

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

 

With this additional module you can use custom infobox templates in STS v4.1.

 

Infobox templates, like other STS templates, contents only plain HTML code, without PHP includes. You can edit them in visual HTML editors, like Dreamweaver etc.

 

It is possible to create templates for individual infoboxes. Read install.txt file inside package.

 

P.S. I was mistaken and have added a file with module at Contribution page 3 times. Administrator - please, remove 2 copies of a file.

Share this post


Link to post
Share on other sites

Hi,

 

I hope that my problem has not been mentioned before in this thread. I have installed STS 4.1 with the latest fixes (June 2006) and followed the guidelines for installing the Default, Index and Product Info under the admin/module. Basically, all I was trying to do is to display a different background color for the main page when a certain product category is selected. Now in the database, the hardware category ID is 1.

 

So I created a copy of the sts_template.html in catalog\includes\sts_templates\test and renamed it index_1.php.html (as suggested on page 5 of the readme file). I assume that this page will automatically load on the browser window when I select hardware category on the home page. But when I click on the Hardware category link, the index_1.php.html does not get invoked.

 

What am I doing wrong? I have followed the readme file as is.

 

Hansi

Share this post


Link to post
Share on other sites

Hi Don,

 

I have a similar problem (see my post). I don't to use the InfoBox STS 4.1 add-in. I also followed the instructions in the manual (readme file) hoping to see what I have changed. and I hope that someone will answer our problem.

 

Hansi

 

Can anyone tell me how I can alter the page which is displayed when you enter a section or sub-section using STS 4, say Graphics cards? i want to alter how it displays the items in that section, but the file it uses is index.php?cPath=1_4

 

If I create a file called index.php_1_4.html or however you do the extensions, it doesn't use this template? instead it shows me what I have set as the default template?

 

How can I do this, I have all other pages altered i.e. front page, product page, checkout etc... using STS v4 but I can't alter the category or sub category section pages because they are a version of index.php

 

could somebody please exaplain what I am doing wrong?

 

Regards

 

Daniel Coates

Share this post


Link to post
Share on other sites
Hi Don,

 

I have a similar problem (see my post). I don't to use the InfoBox STS 4.1 add-in. I also followed the instructions in the manual (readme file) hoping to see what I have changed. and I hope that someone will answer our problem.

 

Hansi

When I said I don't use I meant I don't want to use :-"

Share this post


Link to post
Share on other sites

When using Morepics6with STS I am having issues with the image tags (eg $subimage4small) showing up as text when I haven't selected an extra image. Does anyone know where/what I do to fix this?


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
Share on other sites

if (tep_not_null($product_info['products_image'])) {
 $template['imagesmall'] = tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), PRODUCT_INFO_IMAGE_WIDTH, PRODUCT_INFO_IMAGE_HEIGHT, 'hspace="5" vspace="5"');
 $template['imagelarge'] = tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), '','','');
 // $template['imagelarge'] = tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']);
}

if (tep_not_null($product_info['products_subimage1'])) {
 $template['subimage1small'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage1'], addslashes($product_info['products_name']), PRODUCT_INFO_IMAGE_WIDTH, PRODUCT_INFO_IMAGE_HEIGHT, 'hspace="5" vspace="5"');
 $template['subimage1large'] = tep_image(DIR_EXT_WS_IMAGES . $product_info['products_subimage1'], addslashes($product_info['products_name']), '','','');
 // $template['subimage1large'] = tep_image(DIR_WS_IMAGES . $products['products_subimage1'], $products['products_name']);
} else {
$template['subimage1small'] = '';
}

if (tep_not_null($product_info['products_subimage2'])) {
 $template['subimage2small'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage2'], addslashes($product_info['products_name']), PRODUCT_INFO_IMAGE_WIDTH, PRODUCT_INFO_IMAGE_HEIGHT, 'hspace="5" vspace="5"');
 $template['subimage2large'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage2'], addslashes($product_info['products_name']), '','','');
 // $template['subimage2large'] = tep_image(DIR_WS_IMAGES . $products['products_subimage2'], $products['products_name']);
} else {
$template['subimage2small'] = '';
}
if (tep_not_null($product_info['products_subimage3'])) {
 $template['subimage3small'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage3'], addslashes($product_info['products_name']), PRODUCT_INFO_IMAGE_WIDTH, PRODUCT_INFO_IMAGE_HEIGHT, 'hspace="5" vspace="5"');
 $template['subimage3large'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage3'], addslashes($product_info['products_name']), '','','');
 // $template['subimage3large'] = tep_image(DIR_WS_IMAGES . $products['products_subimage3'], $products['products_name']);
} else {
$template['subimage3small'] = '';
}
if (tep_not_null($product_info['products_subimage4'])) {
 $template['subimage4small'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage4'], addslashes($product_info['products_name']), PRODUCT_INFO_IMAGE_WIDTH, PRODUCT_INFO_IMAGE_HEIGHT, 'hspace="5" vspace="5"');
 $template['subimage4large'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage4'], addslashes($product_info['products_name']), '','','');
 // $template['subimage4large'] = tep_image(DIR_WS_IMAGES . $products['products_subimage4'], $products['products_name']);
} else {
$template['subimage4small'] = '';
}
if (tep_not_null($product_info['products_subimage5'])) {
 $template['subimage5small'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage5'], addslashes($product_info['products_name']), PRODUCT_INFO_IMAGE_WIDTH, PRODUCT_INFO_IMAGE_HEIGHT, 'hspace="5" vspace="5"');
 $template['subimage5large'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage5'], addslashes($product_info['products_name']), '','','');
 // $template['subimage5large'] = tep_image(DIR_WS_IMAGES . $products['products_subimage5'], $products['products_name']);
} else {
$template['subimage5small'] = '';
}
if (tep_not_null($product_info['products_subimage6'])) {
 $template['subimage6small'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage6'], addslashes($product_info['products_name']), PRODUCT_INFO_IMAGE_WIDTH, PRODUCT_INFO_IMAGE_HEIGHT, 'hspace="5" vspace="5"');
 $template['subimage6large'] = tep_image(DIR_WS_IMAGES . $product_info['products_subimage6'], addslashes($product_info['products_name']), '','','');
 // $template['subimage6large'] = tep_image(DIR_WS_IMAGES . $products['products_subimage6'], $products['products_name']);
} else {
$template['subimage6small'] = '';
}

 

adding

} else {
$template['subimage2small'] = '';
}

in sts_product_info.php this seems to have done the job

Edited by mpm

For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
Share on other sites

Working on my first from new os site and am keen to use multiple sts template files but having read th instructions I am uncertain just what steps I need to take to complete each template page. Do I simply rename the basis sts page with the appropriate suffix??

 

a simply step by step proceadure would be appreciated. thanks in advance

Share this post


Link to post
Share on other sites

Just to let you know guys. I have resolved the problem.

 

There is however another issue I just wanted to point out. Some of the code generated by the template still contains nested and redundant <html> and <body> templates (e.g. code generated by by index.php.html and sts_template.html). This will cause problems in some browsers and if the code migrates to XHTML.

Share this post


Link to post
Share on other sites

Hey guys...

 

I have installed STS with the product extra fields contribution. They both work but I have a simple problem at displaying more than one extra field at the product page using STS.

 

I pasted this code which is the product extra fields code:

// START: Extra Fields Contribution v2.0b
$extra_fields_query = tep_db_query("SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef LEFT JOIN  ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id=".$HTTP_GET_VARS['products_id']." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."') ORDER BY products_extra_fields_order");
$counter = tep_db_num_rows($extra_fields_query);
if($counter > 0){
while($extra_fields = tep_db_fetch_array($extra_fields_query)) {
if(!$extra_fields['status'])  // show only enabled extra field
	continue;
	$template['product_extra_field_name'] = '<b>'.$extra_fields['name'].': </b>';
	$template['product_extra_field_value'] = $extra_fields['value'].'<br>';
}
} else {
$template['product_extra_field_name'] = '';
$template['product_extra_field_value'] = '';
}	
// END: Extra Fields Contribution

into sts_product_info.php file and it does display the extra fields but it shows only the last field and not all...

 

For example: Say I have a DVD, that I need to display extra fields with the following order:

 

1. Year

2. Duration of the movie

3. Director

4. Actors

5. Subtitles

 

The page only shows the last field which is Subtitles, even though all other fields are filled properly. Anyone knows a solution?

 

Thanks in advance


There's a diference between living & BEING ALIVE!

Share this post


Link to post
Share on other sites

Hi, this contribution is great, i made my own template and know how to add new boxes, although it is difficult to me cause I'm just discovering oscommerce..

 

I've got some problems with Purchase Without Account -don't work correctly with STS. I've got PWA (some old version) contribution pre-installed in my os edition (which is based on MS2) and I think this is problem..

 

When all fields required at Order Info page are filled correctly, everything is ok, but after filling with incorect values I see blank page..?? After filled with incorect values (example for e-mail:'uiu!.ou.com'), sts do not capture content of Info_Order_Process.php page which is responable of showing error messages and marking filds that content must be changed.

 

File Info_Ordr_Process.php require column_left.php. Maybe this is the problem? Or something? What do You think? :'(

Edited by msbee

Share this post


Link to post
Share on other sites

I was hoping to get some direction/guidance on changing the STS_TEMPLATE contribution.

 

Bascially I want to store the parameter which controls which template to use in the database instead of the page (where it is currently stored).

 

As far as I understand the contribution, whenever the template folder is updated from the admin panel the value of the folder/template being used is updated and stored somehow. I would like to write this value to the database (naturally i would need to create a new table, called templates etc).

 

I guess I need to know which part of the contribution handle the above action?

 

Has anybody any experience in performing a change like this?

 

Thanks in advance.

Campbell

Share this post


Link to post
Share on other sites

has anyone got open featured sets working with STS? I would love a headstart on getting it together...


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
Share on other sites

Hello,

 

Has anybody successfully integrated "Products Tabs" contribution into STS template? I'd like to use "Products Tabs" on my product_info template, but I'm having a problem with integrating it into my template. Has anybody done it already and can help with it? Any help would be appreciated.

 

Thanks in advance.

Irina.

Share this post


Link to post
Share on other sites

Simple Template System (STS) README.txt v1.3

 

Well I keep going round in circles - just exactly where is this package for download?

 

All i can ever find is the Readme stuuf for installation etc.

 

Just a clue as to how to find the download would be good.

 

Guess is just me being stupid, bu afer some 30 years in development and coding, I really need help to find the package!

 

thanks, in anticipation

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

×