Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Does anyone know why my product_info isnt being picked up?

 

Well, i turned of search engine friendly urls under store settings and my template file is now been picked up, except none of the content works and all of the tags are dispayed! and the stylesheet doesn't get picked up!

 

Whats wrong now?

Thanks

Edited by smithkyle1992
Link to comment
Share on other sites

What really doesnt make sense is why the catagories & breadcrums do get picked up!

 

Link: www.wstech.com.au/catalog and view a product!

Link to comment
Share on other sites

Ok, fixed, had to enable it in the admin panel, i wouldnt of thought that the template would even be picked up unless it was turned on, its a shame u have to have serach safe urls turned off!

Link to comment
Share on other sites

Ok, fixed, had to enable it in the admin panel, i wouldnt of thought that the template would even be picked up unless it was turned on, its a shame u have to have serach safe urls turned off!

Kyle, this does not have anything to do with STS, but rather with osC as a whole. The stock osC "Use Search Engine Safe URLS" is not recommended since it was something placed in the osC 2.2 release that was still in the develepment stage. Using the stock SESU you will get unexpected results with many if not all other contributions.

 

If you are wanting this feature, I would suggest that you implement one of the SEO contributions that are available that will give you stable results. :thumbsup:

 

By the way...thanks for posting your results, it really does help others out quite a bit when people take the time to do this. Thanks! :thumbsup:

Edited by bkellum

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Hi,

Been wondering i know you can change the index page for various catagories/manfuactures however is it possiable to change whats included in the content and where it is placed?

 

What i am wanting to do is have a tick box that when ticked (default) it hides all the product thumbnails in that catagory, whats the best way to do this?? is it possiable to implement something like this using STS??

Link to comment
Share on other sites

Hi,

Been wondering i know you can change the index page for various catagories/manfuactures however is it possiable to change whats included in the content and where it is placed?

 

What i am wanting to do is have a tick box that when ticked (default) it hides all the product thumbnails in that catagory, whats the best way to do this?? is it possiable to implement something like this using STS??

 

Anyone have any ideas?

Link to comment
Share on other sites

Anyone have any ideas?
A couple of ways of doing this...

First, would be to search for a contribution that would do this for you. If not, you will need to hard code the PHP files to make it work.

 

Second, a quick-n-dirty way of doing what you want would be to use some old fashioned HTML trickery. :lol: Make a category template that would display all of the product thumbnails. Create a link (tickbox) to a second category template that hides all of the product thumbnails in that category.

 

Third, keep in mind that you can write PHP code directly in your template pages so if you are skilled in PHP you can really come up with some creative ways to do the above. :thumbsup:

 

Hope this helped get you started in the right direction,

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

can sts be expanded to files and folders outside of the catalog directory so that say a page called 'about us' in http://www.mysite.com/company/people/about_us.php can have the same look and feel?

 

2. what does sts detect in files when capture() is run to populate the $content in the template page? can this be emulated in other files.

 

I do have sts_new_pages setup but would like to segrigate information not related to selling through a osc shop/catalog into different folders steming from the server/httproot for administration purposes but would like to keep the theme (inc some features) of the shop echo'd throughout the whole site. The idea is to ease the process of changing the layout of the site through the one template file.

 

Matt

Link to comment
Share on other sites

A couple of ways of doing this...

First, would be to search for a contribution that would do this for you. If not, you will need to hard code the PHP files to make it work.

Does anyone know of one that will do this? i havnt seen any around....

 

Second, a quick-n-dirty way of doing what you want would be to use some old fashioned HTML trickery. :lol: Make a category template that would display all of the product thumbnails. Create a link (tickbox) to a second category template that hides all of the product thumbnails in that category.

This is what i was thinking of, does anyone have a template for how all the content for the catagory pages is layed out?

Would be very appreciated!

Link to comment
Share on other sites

Hi I am having a problem I think may be STS related, but am not sure. I originally posted this problem here: http://www.oscommerce.com/forums/index.php?sho...p;#entry1084964

 

 

The basic problem started when I took out the "catalog" and put all the files into the root. After doing this the "welcome to" message, on the top of the index page, was displaying twice. The "welcome to" on the right that wasn't supposed to be there was pointing to images/table_background_default.gif. The confusing part was there was no table_background.gif in images. I tried to go into the languages index and change the line pointing to table_background_default.gif when I changed this line it would do nothing to the site so I figured STS must be overriding it, however I can't see anything in STS that seems to point to table_background_default.gif.

 

While my problem is now half fixed, I'm still really curious as to why it was happening in the first place, and what in the actual code I would need to change to fix it. Tricky Stuff!

Edited by pulp2
Link to comment
Share on other sites

I found a free OSCommerce template from 7dana.com and it is using STS 2.1 I wonder if someone could give me some step by step instructions on how to upgrade that to the latest version? Or point me in the right direction.

Link to comment
Share on other sites

2. what does sts detect in files when capture() is run to populate the $content in the template page? can this be emulated in other files.

 

http://www.diamondsea.com/sts/sts_faq.html11) How does STS Work?

 

Answer: STS works by selectively capturing the output of the various OSC programs and storing key portions of the output in $template["variablename"] variables. It does this through the STS_START_CAPTURE, STS_STOP_CAPTURE and STS_RESTART_CAPTURE functions.

 

After all the OSC output has been captured, STS reads in the appropriate HTML Template file into memory. It then performs a find-and-replace for each of the $template variables and then sends the updated file to the client's web browser.

 

It also does a little bit of magic trying to detect javascript code and forms so it can layout the code correctly.

Link to comment
Share on other sites

can sts be expanded to files and folders outside of the catalog directory so that say a page called 'about us' in http://www.mysite.com/company/people/about_us.php can have the same look and feel?

 

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

Having looked arround it is my current belief that the file includes/configure.php could be altered to point sts to files outside the catalog directory. on the other hand it may be possible to go into the sts code itself and find where "DIR_FS_CATALOG" is used and substitute it for a hard coded path nested in an if statement:

 

if ( in osc ) { do normal } else { capture info from osc & outside file then build template}

 

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

 

I'm strugaling - Any ideas would help here, many thanks.

 

matt

Edited by MatthewRitchie
Link to comment
Share on other sites

I found a free OSCommerce template from 7dana.com and it is using STS 2.1 I wonder if someone could give me some step by step instructions on how to upgrade that to the latest version? Or point me in the right direction.
This would depend upon how the template was created. For example: If the template was "pure" HTML and CSS, then all you would need to do was use the actual HTML template files, the stylesheet, and copy over any special tags that were created in the sts_user_code.php file to your STSv4.5.2 shop.

 

If the older template was created by modifying the osc code files, such as the files located in the includes/boxes folder, then you will need to merge in those changes to your osC shop as well.

 

By the way, where did you find the "free" STS template?

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

does any one know why this template contrib is adding padding to all my div tags in IE -- doesnt happen in Firefox? any insight is greatly appreciate.

La

Have you tried turning STS off to see if your STS-disabled shop still has the same issues in IE? Also, if this is related to STS, it would have to do with either your stylesheet settings or the HTML table tags in your template that is causing the problem. Try your site without a link to your external stylesheet as well as commented out all inline styles to help troubleshoot.

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Does anyone know of one that will do this? i havnt seen any around....

 

 

This is what i was thinking of, does anyone have a template for how all the content for the catagory pages is layed out?

Would be very appreciated!

Kyle, you could use JavaScript (or Ajax) to make this work. Check out this link for more info:

 

PHP & Ajax for dynamic inline content without total page refresh.

 

Using the info from that link, you could create a div that would include your thumbnails along with the tick box, that once the box is ticked, it would refresh only the content within the div with your new content (hiding the thumbnails in your case).

 

Hope this helped and please post back with your success!

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

This would depend upon how the template was created. For example: If the template was "pure" HTML and CSS, then all you would need to do was use the actual HTML template files, the stylesheet, and copy over any special tags that were created in the sts_user_code.php file to your STSv4.5.2 shop.

 

If the older template was created by modifying the osc code files, such as the files located in the includes/boxes folder, then you will need to merge in those changes to your osC shop as well.

 

By the way, where did you find the "free" STS template?

 

I found them on the 7dana.com site. The one I have uses STS v2.1. I will have to download the latest STS and compare the files I guess to see what needs to be merged/modified.

Link to comment
Share on other sites

Catalog Anywhere

can sts be expanded to files and folders outside of the catalog directory so that say a page called 'about us' in http://www.mysite.com/company/people/about_us.php can have the same look and feel?

 

2. what does sts detect in files when capture() is run to populate the $content in the template page? can this be emulated in other files.

 

I do have sts_new_pages setup but would like to segrigate information not related to selling through a osc shop/catalog into different folders steming from the server/httproot for administration purposes but would like to keep the theme (inc some features) of the shop echo'd throughout the whole site. The idea is to ease the process of changing the layout of the site through the one template file.

 

Matt

Matt,

What you are asking appears to be nothing more than "reverse-engineering" of what STS does for an osC shop. In other words, people use STS in order to layout their osC shop to be in line with their current web site's look and feel, not the other way around.

With that said, what you are wanting to do is actually the easy part. Just create your non-osc pages using the same layout as your STS template pages, just minus the tags. You can use the same stylesheet for all of your pages styles as well.

 

Now as far as session IDs are concerned (and you should be concerend with them), you will need to make sure that your customers session IDs are kept even if they bounce back and forth in and out of your shop and your non-osc pages. If you are using cookies (not preferred), then this is not an issue, but if your are using session IDs in the MySQL database (preferred), then you have some extra work (not much).

 

Take a look at the following contributions to give you some insight on all of this:

 

Products and Categories Anywhere

 

Catalog Anywhere

 

Catalog Anywhere with Categories

 

Content Outside of OSC

 

Osc External Sessions

 

Hope this helped,

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Kyle, you could use JavaScript (or Ajax) to make this work. Check out this link for more info:

 

PHP & Ajax for dynamic inline content without total page refresh.

 

Using the info from that link, you could create a div that would include your thumbnails along with the tick box, that once the box is ticked, it would refresh only the content within the div with your new content (hiding the thumbnails in your case).

 

Hope this helped and please post back with your success!

 

Thanks for that, im going off to have a read of it now!

What file calls on the thumbnails as im presuming this is what i'll need to add the div tags to?

Thanks

Link to comment
Share on other sites

 

Many Thanks for the tips Bill, You are certaily the god sent guru of sts. I will Get started straight away looking through these links.

 

Much Appreciated

 

matt

Link to comment
Share on other sites

Thanks for that, im going off to have a read of it now!

What file calls on the thumbnails as im presuming this is what i'll need to add the div tags to?

Thanks

That would also depend on what other contributions you have installed on your shop. If this is a stock osC shop, then the modules/product_listing.php file would be what I think you would be interested in.

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

I just did a fresh OSC install using fantastico. I then installed STS Power Pack, and everything was workign just fine. The store loaded and that was fine.

 

I went back to the store a few minutes later and now it says:

 

Warning: require(includes/classes/sts.php) [function.require]: failed to open stream: No such file or directory in /home/chineseh/public_html/includes/application_top.php on line 499

Warning: require(includes/classes/sts.php) [function.require]: failed to open stream: No such file or directory in /home/chineseh/public_html/includes/application_top.php on line 499

Fatal error: require() [function.require]: Failed opening required 'includes/classes/sts.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/chineseh/public_html/includes/application_top.php on line 499

 

Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...