Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Actually, there's a bug in that update that may cause this problem (anything you change won't be updated in the modules), which's been reported. You may want to try Steve Ratcliffe/sterat's suggestion:

 

In the file compatibility.php, add 'reset($ar)' to the end of the do_magic_quotes_gpc function, like this:

 

function do_magic_quotes_gpc(&$ar) {

if (!is_array($ar)) return false;

while (list($key, $value) = each($ar)) {

if (is_array($ar[$key])) {

do_magic_quotes_gpc($ar[$key]);

} else {

$ar[$key] = addslashes($value);

}

}

reset($ar);

}

The bold face code is the added line.

 

Good Luck!

 

Ken

Ken is referring to a bug in the osCommerce milestone update 060817, not with STSv4.2 itself.

 

I have found a few other bugs in that update but they do not effect STS however.


Bill Kellum

 

Sounds Good Productions

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

Share this post


Link to post
Share on other sites
Brad, give us a more detailed post regarding what you are trying to do and what you have tried so far. I'm sure it has been done before by some STS user out there.

 

:thumbsup:

I am trying to get my product(s) to show up on the index page template. Really the end result is to be able to copy the template and change the layout so I can have multiple store front/looks with the same oscommerce.

 

But for now I just want to show my products on the index page.

 

Here is my failed attempt thus far: http://www.herbalsecure.com/

Share this post


Link to post
Share on other sites
I am trying to get my product(s) to show up on the index page template. Really the end result is to be able to copy the template and change the layout so I can have multiple store front/looks with the same oscommerce.

 

But for now I just want to show my products on the index page.

 

Here is my failed attempt thus far: http://www.herbalsecure.com/

I think some more information would help...How many products do you have? You may be better served in adding an additional contribution to your store that allows you to show all products on your index.php page and then use STS to arrange the layout.

 

Have you looked at the Featured Product contribution? Also, take a look at Control New Products. Both of these contributions will allow you to manage what products you want to display on your main page. Another contribution that you may be interested in is Star Product.

 

Well, that should be enough to get you going. Please pop back in here and give us updates on your success and tell us how well these contributions integreated with STS.


Bill Kellum

 

Sounds Good Productions

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

Share this post


Link to post
Share on other sites
I think some more information would help...How many products do you have? You may be better served in adding an additional contribution to your store that allows you to show all products on your index.php page and then use STS to arrange the layout.

 

Have you looked at the Featured Product contribution? Also, take a look at Control New Products. Both of these contributions will allow you to manage what products you want to display on your main page. Another contribution that you may be interested in is Star Product.

 

Well, that should be enough to get you going. Please pop back in here and give us updates on your success and tell us how well these contributions integreated with STS.

I have one product, but several packages. So buy 1, 3 or 6 of the asme product. I didnt really want to mess with a bunch of other plugins, I figured this could EASILY support what I am trying to do.

 

ALL I want to do is take ANY product, and display it on the index page.

So... instead of sending them to a product page, the products are listed on the index.

 

Not sure I can really explain it any better.

Share this post


Link to post
Share on other sites
I have one product, but several packages. So buy 1, 3 or 6 of the asme product. I didnt really want to mess with a bunch of other plugins, I figured this could EASILY support what I am trying to do.

 

ALL I want to do is take ANY product, and display it on the index page.

So... instead of sending them to a product page, the products are listed on the index.

 

Not sure I can really explain it any better.

Yep, you need one of the contributions listed in my prior post to do what you want. STS would allow you to design your page any way you want after you have "upgraded" your stock osc to one of the product contributions that give you the added features that you desire.

 

Of course, you could always modify one of the STS Modules so that it would do what you want but you would be on your own there, unless someone else has done this already and wants to share...

 

Either way, I think one of the product contributions would be the easier way to go.


Bill Kellum

 

Sounds Good Productions

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

Share this post


Link to post
Share on other sites
You need the <html $htmlparams> and the <!--$headcontent--> along with your stylesheet link to make any custom templates work for your osCommerce shop. With the code above, you can literally use any HTML page a osCommerce template along with the added placeholders that you want to include.

 

Hope this has helped,

 

Bill Kellum

 

Cheers it works a treat now. My site is 99% running with just one more thing left to do.

 

I am having a bit of trouble with the sessions but I think it is just the way my pages are linked is what is causing me problems.

 

I have in my html template a row of tags like $shoppingcart and $checkout.

Nothing wrong here. But i have also links in my tempate pointing to these pages.

 

If I add a product to my cart and then go to my headers say to $checkout it works fine. But if I go to my navigation link <a href="/store/checkout.php" target="parent"> it just tells me that there is nothing in my cart.

 

So what this tells me is that my sessions arent valid for my navigation links but the headers are picking it up.Is there a way to fix this

 

Is there a way to link to $shoppingcart or $checkout. My links are buttons so I need to attach a header link to the image if you now what I mean

 

Any ideas? Im sure this has come up before.

Share this post


Link to post
Share on other sites
So what this tells me is that my sessions arent valid for my navigation links but the headers are picking it up.Is there a way to fix this

 

Is there a way to link to $shoppingcart or $checkout. My links are buttons so I need to attach a header link to the image if you now what I mean

 

Any ideas? Im sure this has come up before.

Link Graphic to Page:

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'graphic.jpg', 'graphic text') . '</a>'; ?>

 

Text Links:

 

<?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT) . '">' . 'CHECKOUT' . '</a>'; ?>

Change out the names to meet your needs.

 

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

Share this post


Link to post
Share on other sites

Ok, I'm being a bit thick here but I could do with a Brain Dead Dummies Guide to using these templates. I have it installed correctly I think but no matter I do with the templates, everything stays the same. My fault I'm sure :'(

 

In my catalog/includes/sts_templates/test folder I have a few template files inc. sts_template.html which I beleive is the default file.

 

Do I copy and re-name the sts_template file (say as marks_template01.html) and then point to this file?

 

Would I just change the Default template file name in the Default Module?

 

The other thing I'm not sure about is the files containing php in them i.e. product_info.php_27.html.

Is this a required format or would product_info_27.html work just as well?

 

Anyone wanting to explain it in the aforementioned Dummies Guide format would be doing me a huge favour.

 

Thanks. :)

Share this post


Link to post
Share on other sites
Ok, I'm being a bit thick here but I could do with a Brain Dead Dummies Guide to using these templates. I have it installed correctly I think but no matter I do with the templates, everything stays the same. My fault I'm sure :'(

 

In my catalog/includes/sts_templates/test folder I have a few template files inc. sts_template.html which I beleive is the default file.

 

Do I copy and re-name the sts_template file (say as marks_template01.html) and then point to this file?

 

Would I just change the Default template file name in the Default Module?

 

The other thing I'm not sure about is the files containing php in them i.e. product_info.php_27.html.

Is this a required format or would product_info_27.html work just as well?

 

Anyone wanting to explain it in the aforementioned Dummies Guide format would be doing me a huge favour.

 

Thanks. :)

Mark, check the manual for any explainations on how to use the templates. I wrote the manual and think that it is fairly user-friendly. You can use the templates as they are "out of the box". STS4.2 comes with two types of template options: The "test" folder which includes the "sts_template.html" to be used for all of the pages in your shop or the "full" folder which includes several templates that can be used for specific pages in your shop.

 

You can also create your own templates for each page in your store such as index.php.html to be used as a template for your index.php page, or index.php_0.html to have a separate home page to be different from the other index.php_x.html pages within your store (x = your category id).

 

No matter which template you use, whether it be the sts_template.html or your own markstemplate.html, you will have to configure the STS modules to look in the correct template folder as well as name a default template to be used for pages in your store that you have not created a specific template.

 

STS works "out of the box" with the default settings but you will soon want to use different templates for different scenarios which STS makes this available to you. :lol:


Bill Kellum

 

Sounds Good Productions

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

Share this post


Link to post
Share on other sites

Hi Bill,

 

I've sent you a PM and hopefully you will be able to help me. If I can understand it and get it all working, I'll write a little Dummies Guide (real basic step by step stuff) of my own for others who are totally new to .php, coding and setting up web sites like me.

 

Thanks.

Edited by Rugman

Share this post


Link to post
Share on other sites
Link Graphic to Page:

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'graphic.jpg', 'graphic text') . '</a>'; ?>

 

Text Links:

 

<?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT) . '">' . 'CHECKOUT' . '</a>'; ?>

Change out the names to meet your needs.

 

Hope this helped.

 

 

That is excellant stuff but one problem remains.

It's my fault that i didnt explain.

 

I have an roll over effect on image see here

 

<A HREF="/store/index.php" TARGET="_parent"
			ONMOUSEOVER="changeImages('home', 'images/home-over.gif'); return true;"
			ONMOUSEOUT="changeImages('home', 'images/home.gif'); return true;"
			ONMOUSEDOWN="changeImages('home', 'images/home-down.gif'); return true;"
			ONMOUSEUP="changeImages('home', 'images/home-over.gif'); return true;">
			<IMG NAME="home" SRC="images/home.gif" WIDTH=206 HEIGHT=29 BORDER=0 ALT=""></A>

 

If i do the above as you asked ill lose the rollover effect. Is there a way to do this in PHP.

If I cant im goin to have to lose this cool rollover effect :(

Sorry im a pest I know.

Share this post


Link to post
Share on other sites
That is excellant stuff but one problem remains.

It's my fault that i didnt explain.

 

I have an roll over effect on image see here

 

<A HREF="/store/index.php" TARGET="_parent"
			ONMOUSEOVER="changeImages('home', 'images/home-over.gif'); return true;"
			ONMOUSEOUT="changeImages('home', 'images/home.gif'); return true;"
			ONMOUSEDOWN="changeImages('home', 'images/home-down.gif'); return true;"
			ONMOUSEUP="changeImages('home', 'images/home-over.gif'); return true;">
			<IMG NAME="home" SRC="images/home.gif" WIDTH=206 HEIGHT=29 BORDER=0 ALT=""></A>

 

If i do the above as you asked ill lose the rollover effect. Is there a way to do this in PHP.

If I cant im goin to have to lose this cool rollover effect :(

Sorry im a pest I know.

 

Hi ultan,

 

I am having a similar problem. There is an article in the knowledge base about having mouseover effects with graphics located here http://www.oscommerce.info/kb/osCommerce/G..._and_Tricks/271

 

I could not figure out how to get it to work :blush: , but if you have some success please let me know. It looks like your mouseovers were created in imageready same as mine.

 

Laurie

Share this post


Link to post
Share on other sites
Hi Bill,

 

I've sent you a PM and hopefully you will be able to help me. If I can understand it and get it all working, I'll write a little Dummies Guide (real basic step by step stuff) of my own for others who are totally new to .php, coding and setting up web sites like me.

 

Thanks.

 

:thumbsup: Thanks Bill, it's all working now.

 

And now the templates are working I am starting to understand how they work....not easy when they are not working, no way to test anything.

 

I'm sure i'll be back with a few more daft questions.

 

Cheers,

 

Mark

Share this post


Link to post
Share on other sites
Actually, there's a bug in that update that may cause this problem (anything you change won't be updated in the modules), which's been reported. You may want to try Steve Ratcliffe/sterat's suggestion:

 

In the file compatibility.php, add 'reset($ar)' to the end of the do_magic_quotes_gpc function, like this:

 

function do_magic_quotes_gpc(&$ar) {

if (!is_array($ar)) return false;

while (list($key, $value) = each($ar)) {

if (is_array($ar[$key])) {

do_magic_quotes_gpc($ar[$key]);

} else {

$ar[$key] = addslashes($value);

}

}

reset($ar);

}

The bold face code is the added line.

 

Good Luck!

 

Ken

You are correct Ken.

Bill Kellum

 

Sounds Good Productions

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

Share this post


Link to post
Share on other sites

Hi Friends,

just weeks back i downloded oscommerce-2.2ms2-060817 for testing in my local system.

A great programme. Added contributions like STSv4_2 and osCAffiliate v2.6.

sts was not working initially with easyphp [the default selection to won't work] anyway it worked in another local server system vertrigo[i think it has php5]

 

now my issue. how could we integrate the affiliate_box with sts so that affiliate box will be displayed.

can somebody explain step-by-step...

i am a new guy around..please.

thanks

Share this post


Link to post
Share on other sites

I've been playing around with OsC for a couple of years now but not encountered STS until now. I offered to add the Header Tags contribution to a friend's site, not realising that she already had STS 4.1 installed, so I used the HTC files that I had here. It didn't work straight off, so I had a root round the HTC thread and found mention of the combined package, so I've uploaded that now and it works *to a degree.* The category and manufacturer descriptions (which was what led me to ofering to install HTC in the first place) work fine but if I add the headertags.php file to the STS modules via the admin panel all I get is a blank screen, the source code is like this:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

 

I'm just not following the instructions, is there something that needs to go in the template files themselves? Or is it to do with the clean_html_comments stuff?

 

Thanks :)

Share this post


Link to post
Share on other sites

I'm struggling a little with the flow of the template files.

 

I'm trying to get new basic templates set up for each level rather than new ones for each catagory or product.

 

So far I have set up index.php.html and given the same layout to pages like shipping, returns, contact us etc.

 

product_info.php.html has been changed so it's in keeping with the above and I have made a new content/product_info.php.html page which is working well.

 

But, it's the template for the layout of the main catagory page I can't seem to track down. I need to change the size of the images displayed if possible. This page if I'm not being clear:

 

http://www.xxxxxxxxxxxx.co.uk/catalog/index.php?cPath=31_40

 

the page that starts "Lets see what we have here" how do I edit the text of these lines too (in STS) or does this have to be changed in Oscommerce itself?

Share this post


Link to post
Share on other sites

just install STS and all seems to work ok including HTC! beautiful! BUT (see pic below)

 

fix_box.GIF

 

 

 

on the PRODUCT INFO PAGE my banner and the footer is INSIDE THE "add to cart" box!

 

how can i take it out....urr...cracking me head....please help!

 

michael

Share this post


Link to post
Share on other sites
Hi Friends,

just weeks back i downloded oscommerce-2.2ms2-060817 for testing in my local system.

A great programme. Added contributions like STSv4_2 and osCAffiliate v2.6.

sts was not working initially with easyphp [the default selection to won't work] anyway it worked in another local server system vertrigo[i think it has php5]

 

now my issue. how could we integrate the affiliate_box with sts so that affiliate box will be displayed.

can somebody explain step-by-step...

i am a new guy around..please.

thanks

 

I think i have found the answer myself...anyhow its working in localhost.

added affiliate box to sts template by simply adding the following...

require(DIR_WS_BOXES . 'affiliate.php');
 $sts->restart_capture ('affiliatebox', 'box'); // Get What's new box

to file sts_column_left.php in catalog/includes/modules/sts_inc

and added place holder $affiliatebox in respective space in the html template.

Share this post


Link to post
Share on other sites
the page that starts "Lets see what we have here" how do I edit the text of these lines too (in STS) or does this have to be changed in Oscommerce itself?
Mark, I put extra tips in the STS manual on how to edit the exact text you mentioned. If you do not have it in your download for some reason, you can download it from my web site: soundsgoodproDOTcom.

Bill Kellum

 

Sounds Good Productions

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

Share this post


Link to post
Share on other sites
Mark, I put extra tips in the STS manual on how to edit the exact text you mentioned. If you do not have it in your download for some reason, you can download it from my web site: soundsgoodproDOTcom.

 

H'mm, I'm probably being slow here, but Chapter 3.7 Create templates for specific categories (if this is the section you mean) only controls the layout of the page but not the $contents part.

 

I want to be able to alter the way the content is displayed when the categories section comes up on screen.

 

If I'm in the wrong section (which I probably am) can you point me to the right part please.

 

Thanks Bill

Share this post


Link to post
Share on other sites
H'mm, I'm probably being slow here, but Chapter 3.7 Create templates for specific categories (if this is the section you mean) only controls the layout of the page but not the $contents part.

 

I want to be able to alter the way the content is displayed when the categories section comes up on screen.

 

If I'm in the wrong section (which I probably am) can you point me to the right part please.

 

Thanks Bill

Mark, You had mentioned,

 

the page that starts "Lets see what we have here" how do I edit the text of these lines too (in STS) or does this have to be changed in Oscommerce itself?
This is addressed in section 5.5 of the STSv4.2 User Manual. :thumbsup:

Bill Kellum

 

Sounds Good Productions

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

Share this post


Link to post
Share on other sites

Hi,

 

I really love this infobox contrib. Works good. However, I'm just wondering if it's possible for each \includes\sts_templates\full\boxes*.php.html to have individual CSS class under the same \catalog\stylesheet.css

 

It seems like it would only follow my designated class, ONLY if I wipe out the existing .infoBox*** classes defined in stylesheet.css

 

Everything else is "A" OK. One hell of a job this contrib is. Awesome!!!

Share this post


Link to post
Share on other sites
Hi,

 

I really love this infobox contrib. Works good. However, I'm just wondering if it's possible for each \includes\sts_templates\full\boxes*.php.html to have individual CSS class under the same \catalog\stylesheet.css

 

It seems like it would only follow my designated class, ONLY if I wipe out the existing .infoBox*** classes defined in stylesheet.css

 

Everything else is "A" OK. One hell of a job this contrib is. Awesome!!!

Funny, I am actually working on such a beast but seem to never have the time to really focus on it. If anyone else already "invented the wheel" then by all means..."Please stand up!" :D

Bill Kellum

 

Sounds Good Productions

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

Share this post


Link to post
Share on other sites

I am trying to find what file to edit to find THIS: <!-- start cartbox //-->

I need to edit the actual code inside of these variables:

$cartbox

$content

 

Which file do I need to get to to edit the html around the content of the variables?

 

Thanks

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

×