Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 5 votes

[Contribution] STS v4


6117 replies to this topic

#1 rigadin2

  • Community Member
  • 349 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Helsinki/St-Petersburg

Posted 12 April 2006, 08:32

Hi everybody,

Version 4 is a major release of the excellent STS contribution that you can find here: http://www.oscommerce.com/community/contributions,1524,

I started a new thread to not mix with STS v2/v3 questions and because the v2/v3 thread has reached 147 pages! If you have problem with STS v2 or v3, please look here: http://forums.oscommerce.com/index.php?sho...c=58541&st=2920


The main advantages of this release are:

- Less code and several improvements, so should be faster..
- All templates are in their own folder, selection of folder is made in admin. Folder choice can be overwritten from URL for testing purposes.
- Use of modules for code specific to some pages (product_info.php for example), parameters accessible from admin (like shipping, payment or order total modules).
- Write own module for checkout, create account or else: easy to share like payment modules.
- Switch STS on/off from admin. When off, you will see your store like it was before STS installation.
- Debug mode still available from URL, but with a code defined by admin => works like a password.
- If STS is off, using debug mode from URL will turn it on only for you. Useful for testing without disturbing visitors.
- Ready for product page caching. Not implemented yet, but doors are open.
- Possibility to avoid sorting a big array (speed optimization), by adding a special char at the end of the placeholders, for example "$languages" becomes "$languages#". (Can be different on each template).
- Installation is still very easy, modifications only at beginning and end of some files.
- Possibility to have a template for header/columns/footer like always + a template for the content area. Useful with product_info: main template comes from the category where the product is, while the content itself is defined according to the product_info template.
- All boxes are now also available separately, no need to show specials if you want to show tell a friend box, no need to show best sellers if you want to show product notifications.
- Boxes that should not appear on certain pages will have an empty tag => customer won't see the placeholder name (try, in v2.x, $banner without having banner or $languages in checkout process page, you'll see what I mean.
- Possibility to write php script in the templates, like in STS v3.
- Compatible with templates made for STS v2 or v3
- Compatible with templates made for STS PLUS (STS v4.1 is based on STS PLUS 4.0.7, only few small modifications).


STS v4.1 is based on STS PLUS v4.0.7. STS PLUS itself is based on STS v3 but with so many changes in the code that I released it as a separate contribution.
Now, after positive feedback from the community and the blessing from the original author, Brian (great contribution, thanks Brian!), the code is back to where it belongs: STS.

Changelog from STS PLUS v4.0.7:

- UPDATED class sts.php: renewed some parts of the code. Include template file from within the sts class instead of from a separate function, so the template can use $this-> to access methods and variables from the sts class. Added function add_debug ($text, $br=true) that add text to the $sts->template['debug'] with a line break by default, it helps when you want to debug your store.
- DELETED sts_column_right.php as its 1 line code can be put directly in column_left.php
- UPDATED sts_footer.php: no need to record the variable columnright2footer as it does not contain any usable information. sts_display_output is now called from here.
- UPDATED examples in sts_user_code.php.
- UPDATED sts_display_output.php: do not display the template variable 'template_html' in debug mode because it makes the page very long and it only represents the source code of the page => you can look at the source code instead.
- UPDATED module sts_product_info.php v1.0.5 to use templates for products in a specific categories. Template product_info_c32 for products in category ID32 and in sub-categories. Works also for content templates.
- UPDATED sts_column_left.php to not show the reviews infobox when on the product_reviews_info.php page. The infobox and the page are using same variable names and it put mess when the infobox is called before the content of the page. This is a simple workaround. If you want the infobox to display all the time, you have to change the variable names inside the infobox (or inside the script of the page). I have not tested without STS, but I'm pretty sure that the problem is same, if the reviews infobox is placed in the left column.


You can also have a look at the STS PLUS thread here: http://forums.oscommerce.com/index.php?showtopic=187122, as many problems you will face have been discussed there.

- Rigadin
STS v4.5 SP5 is out, and check the STS Power Pack contribution too!
New thumbnailer using phpThumb: oscThumb. Works great.

#2 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 12 April 2006, 09:33

Thanks Rigadin!

Looking forward to using this new version. Having STS and STS Plus combined once again will help push this contribution to the top of the class for OsCommerce! This contribution should be the "integrated" template system for any new OsCommerce packages.

Thank you Brian and Rigadin! :thumbsup:

Bill Kellum
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#3 ianraba

  • Community Member
  • 21 posts
  • Real Name:Ian Raba
  • Location:Hertfordshire

Posted 12 April 2006, 15:22

Bloody hell, FANTASTIC!

#4 scottmason

  • Community Member
  • 19 posts
  • Real Name:Scott Mason

Posted 12 April 2006, 21:40

Ok I've got a question - great contribution by the way and I'm sure when I get it working I won't look back - but

I've just installed STS 4 great, in the sts templates folder supplied there are two folders one called FULL and the other called TEST.

Now do I customise the sts_template.html file in the FULL or TEST folder? which css file does it read from? do I need to create a new css file in the FULL or TEST folders?

Anyway I assumed it was the FULL folder as it seemed it had more in it then made some significant changes to the template like fixed width and center, background colours etc then went to admin and changed the template folder to FULL.

But none of the changes take effect on the site. If I put my old folder called MYSITE in the STS folder - which was included in the old version of STS - then change admin to read from that folder, it works, the changes take effect.

I'm confused

Can you offer any help?

cheers

Edited by scottmason, 12 April 2006, 21:42.


#5 --helmi-

  • Community Member
  • 21 posts
  • Real Name:helmi fischer

Posted 13 April 2006, 01:08

Hi Rigadin.

Thanx You again 4 this great great Contrib!!!! :thumbsup:

Unforunatly i have a little bit confusion about Your instal-Doc:

You write (for Updaters from STS Plus):

Quote

- Delete the following file:
- includes/modules/sts_inc/sts_column_right.php

If I do so, i lost my Content! :blush:
With the "includes/modules/sts_inc/sts_column_right.php" its worx fine, like before.. :rolleyes:


PEACE!

--h-

#6 --helmi-

  • Community Member
  • 21 posts
  • Real Name:helmi fischer

Posted 13 April 2006, 01:11

View Postscottmason, on Apr 12 2006, 10:40 PM, said:

(... )
Now do I customise the sts_template.html file in the FULL or TEST folder? which css file does it read from? do I need to create a new css file in the FULL or TEST folders?

(... )
I'm confused

Can you offer any help?

cheers


Hi ScottMason!

You can put it whereever You like it in Your Tmplates-Folder..!
I make a Folder "MyTemplates" and write it in thje Admin as Templatefolder..!
(Please see the Dox!) :thumbsup:



PEACE!

--h-

#7 rigadin2

  • Community Member
  • 349 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Helsinki/St-Petersburg

Posted 13 April 2006, 05:49

View Post--helmi-, on Apr 13 2006, 04:08 AM, said:

Hi Rigadin.

Thanx You again 4 this great great Contrib!!!! :thumbsup:

Unforunatly i have a little bit confusion about Your instal-Doc:

You write (for Updaters from STS Plus):
If I do so, i lost my Content! :blush:
With the "includes/modules/sts_inc/sts_column_right.php" its worx fine, like before.. :rolleyes:
PEACE!

--h-

When updating from STS PLUS to STS4, you have to delete this file but also modify some others. In your particular case, you have not updated includes/column_right.php. At the beginning of this file it should look like this:
// START STS 4.1
if ($sts->display_template_output) {
  $sts->restart_capture ('content');
} else {
//END STS 4.1
and you will see your content again.

The changes in the files are very small but of course they are important. The doc only tell which file to replace but in fact you should compare before replacing. Here are the changes to do:
- includes/application_bottom.php: remove the STS PLUS code at the beginning of the file, this tag is not used anywhere.
- includes/header.php: remove the STS PLUS code located at the end of the file.
- includes/column_right.php: already mentioned what to do there.
+ Update files in includes/modules/sts_inc and /sts.

Note: the STS contribution is now delivered with 2 template folders: test and full. By default the test folder is used and it contains only one template. Modify this template like you want, as a start. Use the "full" folder when you need examples on how to set templates for some specific pages.

In the delivered templates, the stylesheet used is the one located in the catalog folder. I know it's not really nice but there are some ways to change this. Just remember that link to stylesheet is relative to catalog folder when a script is running, and is relative to the template location when editing it. The variable $templatepath can also be used to dynamically build the link to the stylesheet (see the doc for more details).

- Rigadin
STS v4.5 SP5 is out, and check the STS Power Pack contribution too!
New thumbnailer using phpThumb: oscThumb. Works great.

#8 scottmason

  • Community Member
  • 19 posts
  • Real Name:Scott Mason

Posted 13 April 2006, 07:30

View Post--helmi-, on Apr 13 2006, 02:11 AM, said:

Hi ScottMason!

You can put it whereever You like it in Your Tmplates-Folder..!
I make a Folder "MyTemplates" and write it in thje Admin as Templatefolder..!
(Please see the Dox!) :thumbsup:
PEACE!

--h-


eh, not quite sure what you mean,

Where do I put "MyTemplates" folder and surley admin has to be directed to that folder of the same name. and what about the CSS and the sts_template.html in the FULL folder from the install not working!

#9 FreeLancer

  • Community Member
  • 12 posts
  • Real Name:FreeLancer

Posted 13 April 2006, 11:30

Hi Rigadin.

Thanx You.
Very cool works.

#10 scottmason

  • Community Member
  • 19 posts
  • Real Name:Scott Mason

Posted 13 April 2006, 11:46

View PostFreeLancer, on Apr 13 2006, 12:30 PM, said:

Hi Rigadin.

Thanx You.
Very cool works.


Hi how did you get this to work?

for instance i changed the Admin to read from the test folder, made some changes to the template.html in the test folder, the changes take effect but the place holders are just showing up as text..

the test folder seems pretty empty to me, it only contains the sts_template.html file, should there be other files in there.

I can only get this to work if i put an old mySite folder from STS.v3 and work from that one, if you get what i mean.

the documentaton suggests using the test folder, am i missing something really obvious

#11 FreeLancer

  • Community Member
  • 12 posts
  • Real Name:FreeLancer

Posted 13 April 2006, 11:54

View Postscottmason, on Apr 13 2006, 11:46 AM, said:

Hi how did you get this to work?

for instance i changed the Admin to read from the test folder, made some changes to the template.html in the test folder, the changes take effect but the place holders are just showing up as text..

the test folder seems pretty empty to me, it only contains the sts_template.html file, should there be other files in there.

I can only get this to work if i put an old mySite folder from STS.v3 and work from that one, if you get what i mean.

the documentaton suggests using the test folder, am i missing something really obvious
Goto http://SITE/admin/modules.php?set=sts&modu...ult&action=edit
chahge "test" to "full"

Read STS4.doc

sorry is my english, i'm from Russia

#12 FreeLancer

  • Community Member
  • 12 posts
  • Real Name:FreeLancer

Posted 13 April 2006, 11:55

Hmm..
Header Tags Controller don't works (

#13 FreeLancer

  • Community Member
  • 12 posts
  • Real Name:FreeLancer

Posted 13 April 2006, 12:19

View PostFreeLancer, on Apr 13 2006, 11:55 AM, said:

Hmm..
Header Tags Controller don't works (
YES!
http://forums.oscommerce.com/index.php?sho...=187122&st=280#

Edited by FreeLancer, 13 April 2006, 12:19.


#14 --helmi-

  • Community Member
  • 21 posts
  • Real Name:helmi fischer

Posted 13 April 2006, 12:25

Hi Rigadin..

THANX 4 Your quick help!
No its worx very well!!! :thumbsup:

PEACE!

--h-

#15 --helmi-

  • Community Member
  • 21 posts
  • Real Name:helmi fischer

Posted 13 April 2006, 12:31

View Postscottmason, on Apr 13 2006, 08:30 AM, said:

eh, not quite sure what you mean,

Where do I put "MyTemplates" folder and surley admin has to be directed to that folder of the same name. and what about the CSS and the sts_template.html in the FULL folder from the install not working!



You see the "../includes/STS_TEMPLATES/"
Here are the "TEST"-Folder & the "FULL"-Folder..
Here You can make Your own Templatefolders.

If You make "My_Templates" you hav to sign it into Your Admin-Interface of STS
"..admin/modules.php?set=sts"
--> Template folder
Put in: "MyTemplates" (without any "/" ! )

You see..? :thumbsup:




--h-

#16 scottmason

  • Community Member
  • 19 posts
  • Real Name:Scott Mason

Posted 13 April 2006, 13:04

View PostFreeLancer, on Apr 13 2006, 12:54 PM, said:

Goto http://SITE/admin/modules.php?set=sts&modu...ult&action=edit
chahge "test" to "full"

Read STS4.doc

sorry is my english, i'm from Russia


tried that already, still doesn't work, like i said the only way i get this to work is if i use my old folder that i had for STSv3 and change it to that in admin.

what are the FULL and TEST folders for?

#17 dr_lucas

  • Community Member
  • 219 posts
  • Real Name:Mikey

Posted 13 April 2006, 14:50

I just installed the STS for the first time, quite an easy installation process, but after installing and trying to open the page I keep getting a blank page, tried it in normal mode and also in debug mode (index.php?sts_debug=debug)...
I enabled the mod in my admin (the default one)
am I doing something wrong?

#18 dr_lucas

  • Community Member
  • 219 posts
  • Real Name:Mikey

Posted 13 April 2006, 18:22

I forgot to mention that I installed it on my heavily modded store, and it behave the way I described it in the previous post. I just tried to install it on a brand new osC installation and everything seems to be working fine with the STS. I also triple checked all the files that needed to be modified in the catalog section and everything there seems to be as it should.
This is the link to my store: (that shows a blank page)
http://www.skpiercing.com/index.php?sts_debug=debug
And this is the link to my clean osC test site (that shows fine):
http://www.skpiercing.com/test/index.php?sts_debug=debug

Thanks in advance for any help.

#19 Frisser

  • Community Member
  • 29 posts
  • Real Name:Wilfred Helmig

Posted 13 April 2006, 18:41

Same problem here. My shop worked fine with STS Plus 4.0.7 but after the upgrade my screen is blank. If I disable STS in the admin the shop is working fine!
Double checked everything (i hope...) but it doesn't work.... (I also have headertags installed)

#20 dr_lucas

  • Community Member
  • 219 posts
  • Real Name:Mikey

Posted 13 April 2006, 19:19

View PostFrisser, on Apr 14 2006, 01:41 AM, said:

Same problem here. My shop worked fine with STS Plus 4.0.7 but after the upgrade my screen is blank. If I disable STS in the admin the shop is working fine!
Double checked everything (i hope...) but it doesn't work.... (I also have headertags installed)

I got the header tags contribution installed as well (together with some other contributions and personal modifications that I made).