Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hi,

 

I've only started to work with STS, but as an uneducated guess, yes, you would be correct in saying that you need to define a new template tag.

 

Use, '$informationbox' as an example, and search the STS code for instances of 'informationbox', and build your new template tag (call it $googleinfobox) based on how '$informationbox' works.

 

HTH

 

Peter

Link to comment
Share on other sites

Hi,

 

I'm using this template.  It's wonderful.  However, while adding payment methods, etc, I started checking the checkout procedure (which I haven't done before) and I'm having a display problem.

 

http://www.coastalmermaid.com/problem.htm

 

Well, I couldn't see the template, as the site is not live yet, but all I can say is do you have a seperate file defined just for the checkout procedure ?

 

I'm only just testing STS myself, in a seperate path on our website, and did notice that the link to the checkout (i.e. checkout button) isn't resolving properly, it had gone back to the web root path, up one path ??

 

You could try modifying the /catalog/includes/application_bottom.php file, this setting:

 

$display_debugging_output = 1;

 

Peter

Edited by peterr
Link to comment
Share on other sites

Peter, thank you so much. I enabled the debugging. I don't know what to make of it. Ewww! www.coastalmermaid.com/catalog/index.php

 

You can use this login [email protected] and pwd test123 man, what a mess. But now when I try and login it goes to a blank page with nothing. Maybe I should drop back and punt, start with a fresh install and upload my configuration pages one at a time?

 

Linda

Link to comment
Share on other sites

I have two questions:

1. How do i correctly create links from sts_template to pages like shopping cart, check out and so on?

2. I i want sts_template to be the first page of my site how do i make it so it gets triggered when website is accessed: www.mysite.com and sts_template starts.

 

Thanks

We are not that rich to buy cheap things

Link to comment
Share on other sites

2. I i want sts_template to be the first page of my site how do i make it so it gets triggered when website is accessed:  www.mysite.com and sts_template starts.

 

I think you misunderstand something here: the sts_template is not a starting page,

it is used by the starting page, which is the index.php in the root. So if you want

to start with the template you probably mean to say you want to start with the

index.php, which would be the starting point anyway. Hope to have been of help.

 

Ken

Link to comment
Share on other sites

I think you misunderstand something here: the sts_template is not a starting page,

it is used by the starting page, which is the index.php in the root. So if you want

to start with the template you probably mean to say you want to start with the

index.php, which would be the starting point anyway. Hope to have been of help.

 

Ken

So if i make changes to sts_template does it make changes to index.php automatically? Sorry for dumb questions, but i am very new at this and still trying to figure out the mechanism of ocS with template.

Can you PLEASE explain how does it wok and communicates with ocS.

Thanks,

Ruslan

We are not that rich to buy cheap things

Link to comment
Share on other sites

So if i make changes to sts_template does it make changes to index.php automatically? Sorry for dumb questions, but i am very new at this and still trying to figure out the mechanism of ocS with template. 

Can you PLEASE explain how does it wok and communicates with ocS.

Thanks,

Ruslan

How can i change permission to configure.php file? I get an error message on the main page saying that can write to configure.php. But it won't let me change permission to just r.

Thanks

We are not that rich to buy cheap things

Link to comment
Share on other sites

hi

 

I would like to thank you for this contribution it rocks, I was using infobox manager 2.0 and the latest sts 2.01 i think but my catagories menu is black. it's the only box. the words are there black of course but the back ground to the box does not show up

 

i get a path to pic as /blah/blah/blah/images/infobox_slices/ /blah/blah/blah 'SEE ADDS A SPACE IN BETWEEN THE DIRECTORY'

 

where the other boxes have the correct directory. everything else in the store works to a treat? any idea's I have searched this forum and read and read lol it's huge but can't seem to find anything???

 

 

please :)

Edited by Joedy
Link to comment
Share on other sites

Hi Linda,

 

Tried that login and pwd, got a .........

 

Error: No match for E-Mail Address and/or Password.

 

If you are getting a blank page, it will no doubt be a PHP error, so have a look in your PHP error log file, to see what caused the blank page.

 

Peter

Edited by peterr
Link to comment
Share on other sites

Peter, I'm confused. My sts_template.html is perfect, that's what's loading up top. But underneath is the index.php display. I don't understand. I have the template output=1 so it should be displaying only the template, right?

 

Linda

Link to comment
Share on other sites

I am having an STS problem maybe someone could help me with...

 

I have created graphical navigation links using the '$urlcat_CategoryName' feature, however these links are not working properly with the breadcrumb trail.

 

You can see the store at www.parkerstrophies.com

 

If you click on the 'Trophies' navigation link, you go to trophies. If you click on a subcategory (say Bobbleheads), you go the the Bobblehead Trophy page. If you then use the navigation links to go back to Trophies (main page), it just reloads the Bobbleheads page.

 

If you click on a different link (try Wedding & Gift Items), you go to the correct page, but the breadcrumb trail says Home-Trophies-Bobbleheads-Wedding & Gift Items.

 

Does anyone know a solution for this?

Link to comment
Share on other sites

Hi there,

 

It looks as if your cPath for the 'Trophies' graphic button is incorrect. The link is http://parkerstrophies.com/index.php?cPath=26_22_26 but I think it should really be http://parkerstrophies.com/index.php?cPath=26 because if you click on the 'Trophies' breadcrumb trail at the top of the page then it takes you there okay. You could try this and see if it works for you.

 

Regards,

 

Mark Bowen

 

 

 

I am having an STS problem maybe someone could help me with...

 

I have created graphical navigation links using the '$urlcat_CategoryName' feature, however these links are not working properly with the breadcrumb trail.

 

You can see the store at  www.parkerstrophies.com

 

If you click on the 'Trophies' navigation link, you go to trophies.  If you click on a subcategory (say Bobbleheads), you go the the Bobblehead Trophy page.  If you then use the navigation links to go back to Trophies (main page), it just reloads the Bobbleheads page.

 

If you click on a different link (try Wedding & Gift Items), you go to the correct page, but the breadcrumb trail says Home-Trophies-Bobbleheads-Wedding & Gift Items.

 

Does anyone know a solution for this?

Link to comment
Share on other sites

I used STS for the link which is $urlcat_Trophies, and that creates the cPath for me (or is supposed to!) For some reason STS just keeps adding categories without clearing the old ones, and I don't understand it well enough to know why...

 

But anyway, I tried creating the cPath links manually as you suggested (not through STS) and that made it all work beautifully!:D

 

Thanks for the help!

 

 

Hi there,

 

It looks as if your cPath for the 'Trophies' graphic button is incorrect. The link is http://parkerstrophies.com/index.php?cPath=26_22_26 but I think it should really be http://parkerstrophies.com/index.php?cPath=26 because if you click on the 'Trophies' breadcrumb trail at the top of the page then it takes you there okay. You could try this and see if it works for you.

 

Regards,

 

Mark Bowen

Link to comment
Share on other sites

Glad to be of assistance!!

 

 

Regards,

 

Mark

 

 

 

I used STS for the link which is $urlcat_Trophies, and that creates the cPath for me (or is supposed to!)  For some reason STS just keeps adding categories without clearing the old ones, and I don't understand it well enough to know why... 

 

But anyway, I tried creating the cPath links manually as you suggested (not through STS) and that made it all work beautifully!:D

 

Thanks for the help!

Link to comment
Share on other sites

Could someone please help me get my right column and footer fixed!?

 

I can't seem to find a good explanation of the right and left columns. I've been able to cludge my way around them so far but now I've run into a problem that I just can't get figured out with the right column.

 

The right column is messed up and the footer keeps trying to reside inside of the right column even though in the template file it is at the bottom in its own table.

 

Here is the link to my wifes site and I would really appreciate some help: Christina J's Jewelry

 

Thanx, Dave.

Link to comment
Share on other sites

Could someone please help me get my right column and footer fixed!?

 

I can't seem to find a good explanation of the right and left columns. I've been able to cludge my way around them so far but now I've run into a problem that I just can't get figured out with the right column.

 

The right column is messed up and the footer keeps trying to reside inside of the right column even though in the template file it is at the bottom in its own table.

 

Here is the link to my wifes site and I would really appreciate some help: Christina J's Jewelry

 

Thanx, Dave.

 

Some tag isn't closed somewhere. Have you monkied any of the osC files around? If so you'll just have to dig until you find it. Open your page (any page) copy the source, paste into a new html file and go to town looking for it.

 

OK. I'll do it for you (feeling fussy this evening, sorry about that)

 

Find

<!-- end content //-->
</td>
       <td width="165" align="right" valign="top" class="columnright"><p class="infoBox">
    
<!-- start cartbox //-->

<!-- end cartbox //-->
<br>
          
<!-- start bestsellersbox //-->

<!-- end bestsellersbox //-->
<br>
         
<!-- start currenciesbox //-->

<!-- end currenciesbox //-->
</p>  </td>
     </tr>
   </table>
<p> </p>
<table width="100%" border="1" align="center" cellspacing="0" bordercolor="#FF00FF">
   <tr>
     <td bordercolor="#FF00FF" class="footer"> </td>
   </tr>
</table>
</td>
 </tr>
</table>
<br>
</body>
</html>

 

Replace with

 

<!-- end content //-->
</td>
     </tr>
   </table>
 </td>
 </tr>
</table>
<p> </p>
<table width="100%" border="1" align="center" cellspacing="0" bordercolor="#FF00FF">
   <tr>
     <td bordercolor="#FF00FF" class="footer"> </td>
   </tr>
</table>
</td>
 </tr>
</table>
</td>
 </tr>
</table>
<br>
</body>
</html>

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

Still having problems with the footer and right column

 

Iggy, I appreciate the effort but I think my problem is a little more cryptic.

 

I have since gone through and commented almost everything out of the left and right columns and all of the code that I added to the sts display and user_code files.

 

I've gotten it to the point that when you are looking at one of the products, all of the sections display correctly.

 

BUT, on most (not all) other pages, the footer appears embedded in the right hand column.

 

I would really appreciate some help on this as I have spent 2-3 days working on this and I'm not sure what to do next.

 

Thanx, Dave.

Link to comment
Share on other sites

Hi,

 

When I display your template , it looks okay, left and right columns, footer where it should be,etc.

 

Therefore, the problem is being caused by modifications you have made to some of the include files, like:

 

header.php

column_left.php

column_right.php

footer.php

 

that can be the only way you are getting the table misalignment, as you are now experiencing.

 

Peter

Link to comment
Share on other sites

So if i make changes to sts_template does it make changes to index.php automatically? Sorry for dumb questions, but i am very new at this and still trying to figure out the mechanism of ocS with template. 

Can you PLEASE explain how does it wok and communicates with ocS.

Thanks,

Ruslan

 

Hi Ruslan,

 

I'm no expert at these things but my understanding of STS is this:

 

When index.php is called, it has to display something. As standard in in osC, it calls various files, which hold the diaply layout for different areas of the page, and builds the page from them. This is a fairly tricky process to visualise for many of us so this contribuion was created to allow you to create a 'template' in an HTML page, thus allowing you to create it in a WYSIWYG editor so you can see where everything is going and what it will look like.

 

This 'template' then replaces the calls that index.php has to other files to tell it how to lay out the page and instead completely controls the layout.

 

So when you make changes to sts_template, it doesn't actually alter the index.php file instead, when index.php asks it how to lay out the display, it will instruct it to lay out the page however you have specified.

 

It works superbly well in my opinion and can also provide different layouts for different pages. For instance, we have a different page layout for our Checkout pages than for our product pages just to make things fit on the screen a little better.

 

I hope this has helped

 

Regards

 

Peter

Link to comment
Share on other sites

In trying to fix a problem with the display of my right column I reloaded STS with the original files. Everything started working correctly but without any changes that I had made, just the default install. Then I started comparing my old files with the default files and I don't know how but the default column_right.php is radically different than my modified file. I didn't add all of the extra code so what is going on? The other thing is that the text on the $ID line is different so I'm thinking that somehow I managed to load an old version one time or the other.

 

Here is the code from each file, they are both column_right.php

 

Default STS file that I reverted to:

<?php
/*
 $Id: column_right.php,v 1.1 2003/09/08 19:26:22 jhtalk Exp jhtalk $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 // STS: ADD
 $sts_block_name = 'columnleft2columnright';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD
   
 require(DIR_WS_BOXES . 'reviews.php');

 // STS: ADD
 $sts_block_name = 'reviewsbox';
 require(STS_RESTART_CAPTURE);

?>

 

File that was on my server when I was having problems:

<?php
/*
 $Id: column_right.php,v 1.17 2003/06/09 22:06:41 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require(DIR_WS_BOXES . 'shopping_cart.php');

// MY_WISHLIST	v1.0
include(DIR_WS_BOXES . 'wishlist.php');
// MY_WISHLIST	v1.0

//  if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');
 require(DIR_WS_BOXES . 'search.php');
 require(DIR_WS_BOXES . 'ssl.php');
 require(DIR_WS_BOXES . 'information.php');

 include(DIR_WS_BOXES . 'currencies.php');

//  if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

//  if (isset($HTTP_GET_VARS['products_id'])) {
//    if (tep_session_is_registered('customer_id')) {
//      $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");
//      $check = tep_db_fetch_array($check_query);
//      if ($check['count'] > 0) {
//        include(DIR_WS_BOXES . 'best_sellers.php');
//      } else {
//        include(DIR_WS_BOXES . 'product_notifications.php');
//      }
//    } else {
//      include(DIR_WS_BOXES . 'product_notifications.php');
//    }
//  } else {
//    include(DIR_WS_BOXES . 'best_sellers.php');
//  }

//  if (isset($HTTP_GET_VARS['products_id'])) {
//    if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');
//  } else {
//    include(DIR_WS_BOXES . 'specials.php');
//  }

 // STS: ADD
 $sts_block_name = 'columnleft2columnright';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

 require(DIR_WS_BOXES . 'reviews.php');

 // STS: ADD
 $sts_block_name = 'reviewsbox';
 require(STS_RESTART_CAPTURE);
 // STS: EOADD

//  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
//    include(DIR_WS_BOXES . 'languages.php');
//    include(DIR_WS_BOXES . 'currencies.php');
//  }

?>

 

I would really appreciate if someone could give me an idea as to why these two versions of the same file are so different when I only made a few changes to the bottom code window.

 

Thanx, Dave.

Link to comment
Share on other sites

It won't be in this file. Either the unclosed tables are in your template or they're inside one of the files that generates the boxes or footer in the right column. It's already narrowed down in that the mistake is somewhere in the last 3 things to be added to the template. Go find and examine those files. Have you made any changes to anything in boxes?

 

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

I did finally figure out that my column_left.php had an unclosed IF ELSE statement at the very bottom of the file.

 

But I'm still concerned as to why my original column_right.php has so much more code than the column_right.php that I pulled from the zip file?

 

Dave.

Link to comment
Share on other sites

hijacking for a second.. no matter what i do i cant get my product_info template to work.. it just comes up with the default sts_template.. i've tried everything.. is this a common bug or have i installed STS wrong, possibly?

 

What everything have you tried?

 

Iggy

Everything's funny but nothing's a joke...

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...