Jump to content
DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Mike,

What have you tried so far? Keep in mind there are two shopping_cart.php files. One is an infobox that you can template (see the following link for more details on this: http://forums.oscommerce.com/index.php?sho...p;#entry1227006

and the other a page that you can simple create a template for: shopping_cart.php.html.

 

Thanks bill,

 

I have created the shopping_cart.php.html file according to the sample in test folder.

But i am having trouble to find instruction to create infobox template.

 

The forum link yo given me shows hundreds of posts; but i can not locate instruction as to create infobox template.

What i did find out is that you have a link here

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

 

In this contribution you added "Infobox Templates for use with STSv4.2"

I compared the boxes.php file in includes\classes, it seems that my current STS V4.5.8 has a newer version of boxes.php

 

So in problem again!, please help!

 

My purpose is just to change style of shopping cart content, like make

"Remove Product(s) Qty. Total " bold etc

Share this post


Link to post
Share on other sites

Hi,

 

I have been searching to no avail on 2 issues

1) POPUP IMAGE PROBLEM

2) WORLDPAY

 

if anybody could offer any solutions/pointers I would be really very grateful.

 

1) Is there any way to still use search engine friendly urls and STS and still have a popup image from products. At the moment it displays the normal template and it is only by turning off SEO URLs that the proper popup file displays - this happens whether I use template for popup image or not.

 

We need the SE urls for SEO so I'm a bit stuck here.

 

2) When the site loads wpcallback.php it has problems because it has all the placeholder tags showing. I have tried the fixes posted away back to solve this but cannot.

 

Is it possible to stop STS templating this page or should I try creating a special template for this page if so - any advice on how to go about it?

 

 

I'm new to this and a bit lost to exactly how it works.

So any help would be really gratefully received.

 

Thanks,

 

TW

Share this post


Link to post
Share on other sites

Notice that my site keep changing the layout for every page depending on the number of products in the particular category and the length of the displayed texts. I would like to fix my layout like having everything fixed within fixed-size boxes regardless of the length of the text and etc. Could it be done in STS?

 

Sorry. I am kinda noob here and desperately need a kind soul to enlighten me.

 

Thanks.

Share this post


Link to post
Share on other sites
Notice that my site keep changing the layout for every page depending on the number of products in the particular category and the length of the displayed texts. I would like to fix my layout like having everything fixed within fixed-size boxes regardless of the length of the text and etc. Could it be done in STS?

 

Sorry. I am kinda noob here and desperately need a kind soul to enlighten me.

 

Thanks.

 

 

Can you give more information. Not really sure exactly what you mean.

 

What changes and what do you want to achieve?

 

TW

Share this post


Link to post
Share on other sites
Can you give more information. Not really sure exactly what you mean.

 

What changes and what do you want to achieve?

 

TW

 

Thanks for reply. Pardon me for my bad english.

 

Well. let's start from the fresh copy of oscommerce. You will see that when number of products in a particular categories are different, the size of the product listing box changes. And also, when the length of a particular page (shipping.php, contact_us.php) changes, the size of the box changes also. Having said that, I should conclude that the footer position keep changing every click on the site. So, my query is that is there anyway that we could at least fix the size of all the boxes, for instance, makes the position of the footers fix regardless of the size/length of the content, by using STS.

 

Sorry for my ignorance in HTML and PHP as I have totally no clue how to proceed.

 

Thank you.

Share this post


Link to post
Share on other sites
Thanks for reply. Pardon me for my bad english.

 

Well. let's start from the fresh copy of oscommerce. You will see that when number of products in a particular categories are different, the size of the product listing box changes. And also, when the length of a particular page (shipping.php, contact_us.php) changes, the size of the box changes also. Having said that, I should conclude that the footer position keep changing every click on the site. So, my query is that is there anyway that we could at least fix the size of all the boxes, for instance, makes the position of the footers fix regardless of the size/length of the content, by using STS.

 

Sorry for my ignorance in HTML and PHP as I have totally no clue how to proceed.

 

Thank you.

 

Better to clarify a little bit here just to make sure people do understand me.

 

My question here is to get fixed layouts for every page but with things changing inside the fixed layouts. www.topshop.com has a fixed layout where the content box does not resize regardless of text length, no. of products and etc. I just wonder is it possible to do so in Osc with the great contribution of STS.

 

Thank you.

Share this post


Link to post
Share on other sites
Better to clarify a little bit here just to make sure people do understand me.

 

My question here is to get fixed layouts for every page but with things changing inside the fixed layouts. www.topshop.com has a fixed layout where the content box does not resize regardless of text length, no. of products and etc. I just wonder is it possible to do so in Osc with the great contribution of STS.

 

Thank you.

 

I'm still not 100% clear but I think that what you need is to look into using css/ (x)html to achieve what you want.

 

I am not an STS expert but I do know that STS is about making it easy to change the layout of lots of pages at once rather than having to edit every single page.

 

So, yes it would be useful because it would help you change lots of pages at once but STS itself isn't what would give you the layout you want.

That would be a case of building html css templates that do what you need and then using STS to apply that template to your site.

 

Hope this helps. If you can give a clearer example of what you want I might be able to help you with the css side of things if I have time.

 

Are you talking about fixed width? Or maybe fixed width of the side columns?

Or perhaps you want fixed height?

This is where I am not clear what you are after.

 

If you can explain what needs to be fixed and what not that would help.

 

No need to apologise for bad english. I can only speak english so you are doing great having more than one language!

 

TW

Share this post


Link to post
Share on other sites
I'm still not 100% clear but I think that what you need is to look into using css/ (x)html to achieve what you want.

 

I am not an STS expert but I do know that STS is about making it easy to change the layout of lots of pages at once rather than having to edit every single page.

 

So, yes it would be useful because it would help you change lots of pages at once but STS itself isn't what would give you the layout you want.

That would be a case of building html css templates that do what you need and then using STS to apply that template to your site.

 

Hope this helps. If you can give a clearer example of what you want I might be able to help you with the css side of things if I have time.

 

Are you talking about fixed width? Or maybe fixed width of the side columns?

Or perhaps you want fixed height?

This is where I am not clear what you are after.

 

If you can explain what needs to be fixed and what not that would help.

 

No need to apologise for bad english. I can only speak english so you are doing great having more than one language!

 

TW

 

Thanks for that. Yeah. I am talking about both fixed width and height. Take product info page as example, whenever the length of the description text is different, the height of that box ($content for product info page) is different. So, product info page for product "Microsoft Internet Keyboard PS/2" is short while that for product "Matrox G200 MMS" is longer. Can you enlighten me how to use CSS to fix the box size as I have tried many times but failed.

 

Thank you in advance.

 

 

 

 

Yah. I am thinking of using CSS, but I have no idea how to make fixed height for that box.

Share this post


Link to post
Share on other sites
Thanks for that. Yeah. I am talking about both fixed width and height. Take product info page as example, whenever the length of the description text is different, the height of that box ($content for product info page) is different. So, product info page for product "Microsoft Internet Keyboard PS/2" is short while that for product "Matrox G200 MMS" is longer. Can you enlighten me how to use CSS to fix the box size as I have tried many times but failed.

 

Thank you in advance.

 

 

 

 

Yah. I am thinking of using CSS, but I have no idea how to make fixed height for that box.

OsCommerce works best with a non-fixed height. If you have a fixed height, you will end up with up and down scroll bars on the right, similar to how frames work.

 

If you want it, just create a style that has your fixed width and height and then apply that style to your table.

 

For example:

 

In your stylesheet, add something similar to:

.content_table {
background-color: #FFFFFF;
text-align:center;
width:500px;
height:400px;
}

Then in your template, add the style to your table:

 

<table border="0" cellpadding="3" cellspacing="0" class="content_table">
 <tr> 
<td valign="top"> 

<p>$content</p>

</td>

 </tr>
</table>

 

Hope this helped,

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

Share this post


Link to post
Share on other sites
Thanks bill,

 

I have created the shopping_cart.php.html file according to the sample in test folder.

But i am having trouble to find instruction to create infobox template.

 

The forum link yo given me shows hundreds of posts; but i can not locate instruction as to create infobox template.

What i did find out is that you have a link here

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

 

In this contribution you added "Infobox Templates for use with STSv4.2"

I compared the boxes.php file in includes\classes, it seems that my current STS V4.5.8 has a newer version of boxes.php

 

So in problem again!, please help!

 

My purpose is just to change style of shopping cart content, like make

"Remove Product(s) Qty. Total " bold etc

Mike,

 

The link should have at least gotten you to the page that I discussed the topic.

Here is the link that should go directly to the post:

http://forums.oscommerce.com/index.php?s=&...t&p=1227769

 

:thumbsup: Also, STSv4.2 was prior to when infobox templates were "integrated" into STS. Now, it is built into STS so that information regarding "Infobox Templates for use with STSv4.2" is no longer valid for STS versions 4.3 and above.

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

Share this post


Link to post
Share on other sites
Hi,

 

I have been searching to no avail on 2 issues

1) POPUP IMAGE PROBLEM

2) WORLDPAY

 

if anybody could offer any solutions/pointers I would be really very grateful.

 

1) Is there any way to still use search engine friendly urls and STS and still have a popup image from products. At the moment it displays the normal template and it is only by turning off SEO URLs that the proper popup file displays - this happens whether I use template for popup image or not.

 

We need the SE urls for SEO so I'm a bit stuck here.

 

2) When the site loads wpcallback.php it has problems because it has all the placeholder tags showing. I have tried the fixes posted away back to solve this but cannot.

 

Is it possible to stop STS templating this page or should I try creating a special template for this page if so - any advice on how to go about it?

 

 

I'm new to this and a bit lost to exactly how it works.

So any help would be really gratefully received.

 

Thanks,

 

TW

Answer to #1:

You should NEVER turn on the Search Engine URLS in the Admin. This will make your shop unstable and the result is unpredictable. If you think you need this option, you would need to install one of the SEO contributions to accomplish this.

 

Answer to #2:

Yes, you can turn off specific pages from being templated. I listed the steps to do so in the following post:

 

http://forums.oscommerce.com/index.php?sho...p;#entry1222434

 

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
Hi there,

 

Three pipe problem

After weeks of experimenting I got stuck in trying to get product ranking in the Admin side.

I want to rank products (books) in the admin panel without the use of the review module.

It is a ranking done by the administrator and it is fixed for each product. It seems simple

but I can't find where to do it and how.

 

How does it work?

As the administrator I want to rank a booktitle with 3 stars stars (out of 5) in the admin side (add product page).

When a customer finds the book in the webshop they see this ranking by the display of these three stars.

This ranking works independently from the review ranking (there is no link).

 

Can somebody please help me?

 

Kind regards,

 

Jeff

Jeff,

This is the support thread for the Simple Template System. Please post your question above in the General Support thread. :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
OsCommerce works best with a non-fixed height. If you have a fixed height, you will end up with up and down scroll bars on the right, similar to how frames work.

 

If you want it, just create a style that has your fixed width and height and then apply that style to your table.

 

For example:

 

In your stylesheet, add something similar to:

.content_table {
background-color: #FFFFFF;
text-align:center;
width:500px;
height:400px;
}

Then in your template, add the style to your table:

 

<table border="0" cellpadding="3" cellspacing="0" class="content_table">
 <tr> 
<td valign="top"> 

<p>$content</p>

</td>

 </tr>
</table>

 

Hope this helped,

 

I got it. Thanks so much. Now I shall explore CSS to do customization.

Share this post


Link to post
Share on other sites

(i moved this post to the Version 4 thread)

 

I just did the STS v4.5.8 install for 2.2RC2.

 

When i click on "STS" under the Admin > Modules.... it pulls up the Payment Modules instead of the STS.

I have re-copied all of the files twice to make sure they copied correctly. Same problem

 

 

What did i do wrong? and How can i fix this?

Edited by shana.jk

Share this post


Link to post
Share on other sites

Is there any way to break down the $content code?

 

For example...

 

<h1 class="pagetitle">$pagetitle</h1>

<div class="column1-unit">
<p>$pagecontent</p>
</div>
<hr class="clear-contentunit" />

 

Also I have a width of 540px to fit the shop into. Is there any way in this template system to restrict the widths of the tables? or do I need to edit the actual oscommerce files?


Gazza

If its not broken...why try fixing it??

Share this post


Link to post
Share on other sites

STS is working fine now with my template, but POPUP IMAGE is not working.

In my System the Contribution "More Pics" is installed - but no popup images are coming up...missing code in some sts files ?

Edited by runweb

OSC Webmakers Edition modiefied with many other contribs and enhancements.

+ STS 4.5.7 for 2.2MS2 and RC1

Share this post


Link to post
Share on other sites
STS is working fine now with my template, but POPUP IMAGE is not working.

In my System the Contribution "More Pics" is installed - but no popup images are coming up...missing code in some sts files ?

The problem may be with your product_info "content" templates or your popup_image.php.html template. If you are using content templates, try turning this option off in the admin. If the MorePics are showing with the content template option turned off, it means you need to add some code.

 

Remember, whatever changes you make to the product_info.php file, you need to make these same changes in the sts_inc/product_info.php file as well.

 

:thumbsup: Look in the STSv4 Power Pack site for the very first download that includes MorePics integration.


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
Answer to #1:

You should NEVER turn on the Search Engine URLS in the Admin. This will make your shop unstable and the result is unpredictable. If you think you need this option, you would need to install one of the SEO contributions to accomplish this.

 

Answer to #2:

Yes, you can turn off specific pages from being templated. I listed the steps to do so in the following post:

 

http://forums.oscommerce.com/index.php?sho...p;#entry1222434

 

Hope this helped,

 

 

yes very helpful.

Thanks.

Bad news about SE friendly urls though :-( More work.

Share this post


Link to post
Share on other sites

Just felt I should leave a small post to show my content with this contribution. I know you guys get grief when things don't go right on the installers end, but so far ( crossing fingers ) on a production website I've put together during the past two weekends I am VERY happy with STS.

 

Great functionality, does everything I'd want to do without having to deal with OSC's fundamental flaw of not being templated out of the box. Seriously great addition that brought me back to this bit of software. :thumbsup: to whoever create, continues to support, and replies to anyones questions.

Share this post


Link to post
Share on other sites
Just felt I should leave a small post to show my content with this contribution. I know you guys get grief when things don't go right on the installers end, but so far ( crossing fingers ) on a production website I've put together during the past two weekends I am VERY happy with STS.

 

Great functionality, does everything I'd want to do without having to deal with OSC's fundamental flaw of not being templated out of the box. Seriously great addition that brought me back to this bit of software. :thumbsup: to whoever create, continues to support, and replies to anyones questions.

Thanks for the kind words! :rolleyes:


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'd like to know where i can download the sts. i click on the link http://www.oscommerce.com/community/contributions,1524 and there is no place that i see to download this addon, is there something big i am missing? i bet you i am!

 

thanks

 

Josh, I'm not sure if you are the same "josh josh" that just downloaded it from my site.....

 

At the link you posted, there is a green arrow that points downward as in "download". Click on that arrow to download the contribution.


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've got a slight issue with STS and the Infoboxes.

 

I notice that the $headertext placeholder returns not just the header text for the infobox.

 

Instead I'm getting this on the new products on the home page (example):

<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
   <td class="infoBoxHeading" width="100%">New Products For April</td>
 </tr>
</table>

 

I was expecting just to get "New Products For April" and can then use my templates to sort out the layout around it.

 

I've tried following it through the code, but I get lost before I can find where $headertext is set to the above.

Share this post


Link to post
Share on other sites

A little more fiddling, and I think I've found it.

 

Includes/classes/boxes.php (the one STS give you).

 

Look for this section of code , should be lines 233 - 260:

  class contentBoxHeading extends tableBox {
   function contentBoxHeading($contents) {

 	  // START  STS
    global $sts;
    if ($sts->infobox_enabled == true) {
       $info_box_contents = array();
       $info_box_contents[] = array(array('params' => 'class="infoBoxHeading" width="100%"',
                                          'text' => $contents[0]['text']));

      $this->infoBoxHeaderTemplate($this->tablebox($info_box_contents),$right_arrow);
    } else {
     $this->table_width = '100%';
     $this->table_cellpadding = '0';

     $info_box_contents = array();
     $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
                                        'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')),
                                  array('params' => 'height="14" class="infoBoxHeading" width="100%"',
                                        'text' => $contents[0]['text']),
                                  array('params' => 'height="14" class="infoBoxHeading"',
                                        'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif')));
       $this->tableBox($info_box_contents, true);
    }
 	  // END STS

   }
 }

 

Replace line 243:

 

	      $this->infoBoxHeaderTemplate($this->tablebox($info_box_contents),$right_arrow);

 

With:

 

	      $this->infoBoxHeaderTemplate($contents[0]['text'],$right_arrow);

 

This should only affect the headings, and as far as I see doesn't upset anything else.

 

Please correct me if I'm wrong.

Share this post


Link to post
Share on other sites

You are missing the point of the infobox templates. To use them, you have two options per each infobox template that you create:

  1. A template for the header (top)
  2. A template for the content (bottom)

The top template should be called infobox_scriptname_header.php.html.

The bottom template should be called infobox_scriptname.php.html.

 

If you do not want to create a separate header template, just create one and name it infobox_scriptname.php.html.

 

Having two separate templates allow you to do anything that you want with either one (no need to dig into the boxes.php file at all). You could put your own text in there if you want or have it use dynamic text with the $headertext tag or create your PHP code to do whatever you want, all within the template.

 

 

 

A little more fiddling, and I think I've found it.

 

Includes/classes/boxes.php (the one STS give you).

 

Look for this section of code , should be lines 233 - 260:

 class contentBoxHeading extends tableBox {
function contentBoxHeading($contents) {

// START STS
global $sts;
if ($sts->infobox_enabled == true) {
$info_box_contents = array();
$info_box_contents[] = array(array('params' => 'class="infoBoxHeading" width="100%"',
'text' => $contents[0]['text']));

$this->infoBoxHeaderTemplate($this->tablebox($info_box_contents),$right_arrow);
} else {
$this->table_width = '100%';
$this->table_cellpadding = '0';

$info_box_contents = array();
$info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')),
array('params' => 'height="14" class="infoBoxHeading" width="100%"',
'text' => $contents[0]['text']),
array('params' => 'height="14" class="infoBoxHeading"',
'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif')));
$this->tableBox($info_box_contents, true);
}
// END STS

}
}

 

Replace line 243:

 

 $this->infoBoxHeaderTemplate($this->tablebox($info_box_contents),$right_arrow);

 

With:

 

 $this->infoBoxHeaderTemplate($contents[0]['text'],$right_arrow);

 

This should only affect the headings, and as far as I see doesn't upset anything else.

 

Please correct me if I'm wrong.


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

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

×