Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Create templates for specific categories

The insructions for this are very vague, and I cant seem to get it to work. I have the product info part and the index working, but not this.

I also want to be able to control the content of the categories so I can change the layout of how the products are displayed.

 

Thanks,

Tim

 

 

Tim, you need to understand this part of STS as it is very powerful and will open your eyes to the flexibility that STS offers in your designs.

 

View the HTML documents in the "docs" folder that came with STSv4.5.8. In there, you will see a detailed description of how you can make specific templates for specific categories/subcategories and products in specific categories, etc.

 

You may also benefit from my previous post regarding how to name these templates:

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

 

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

 

Hope that helped you out,

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 Bill,

 

The only reason, is that I am finding it easier to check a modules installation is correct, by flicking between the sts and normal shop.

 

Its helped me identiify a few issues, and it does work when installed shop side only when its installed on the shop side and on the STS I cant switch without getting the black top half of the screen when in sts.

 

I will check the lightbox thread for getting the popup dispaly sorted so it has the full feature set, but may still have the problem with the black screen if i awant to switch between the sts and osc.

 

 

At least I can have it functioning to some degree with no problematic errors which is a good place to be starting from for a fine tune.

 

Thanks for your help

 

Johnny

 

The problem was I had [code<script language="javascript">[/code] with no closing tag in my catalog/product_info.php just somthing so simply cant half make a mess and guess its always worth double checking that the tags are closed off.

 

Thanks

Johnny

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

I'm loving STS so far, but I have a new, and very unusual issue.

 

I wanted to install SEO URLs before I went live. I went to download the mod and it's one of those with 4billion entries. I took the latest, and noticed someone made an "auto installer". WOOT! So I tried it, and it failed miserably.

 

No problem, I'll download the regular 2.7, and do it manually. Still no dice. Turns out, if you go to the right thread, and find the right page, you'll see folks saying "Idiot, don't use 2.7, we all use 2.1"

 

Fine. I uninstall (go backward through install instructions) 2.7 and get half way through 2.1 when I realize... these don't work with Windoze servers. /facepalm.

 

FINE... I'll just get it all out.

 

I went backward and restored all the files I could see that were modified. But now, no matter what page I go to, it pulls my index page and displays it. (sts_template.php.html) See it here: www.woodwerks.com/catalog.

 

I have a separate page for category "Cut" called index.php_30.html. It actually works. But none of my product pages work anymore.

 

I am assuming this is an SEO URL issue. Even though I've restored everything, SEO URL still shows up in my admin. Still trying to figure out how to remove that. I'm asking here, because I'm wondering if anyone (Bill :) ) could give me some clues, based on my index page showing up for all sub pages all of a sudden.

 

I really appreciate any and all help.

 

Boom

Link to comment
Share on other sites

[

 

'bkellum' date='Apr 24 2009, 01:13 AM' post='1393825'

 

Consider your layout...

 

You should have a table that extends the full width.

Then separate tables underneath that table.

 

If you do that, there is no way for the content to creep into the upper table.

 

 

Thanks Bill, I appreciate your time and your advice.

 

I have checked my table layout and I believe that I do have set width amounts for each.... I'm curious to know if when you looked, you saw something on the contrary, and if so, where?

 

Sol

Link to comment
Share on other sites

Thanks Bill, I appreciate your time and your advice.

 

I have checked my table layout and I believe that I do have set width amounts for each.... I'm curious to know if when you looked, you saw something on the contrary, and if so, where?

 

Sol

 

If you have IE, install the Web Developer Toolbar: Use it.

If you have Firefox, install the Web Developer add on: Use it.

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'm loving STS so far, but I have a new, and very unusual issue.

 

I wanted to install SEO URLs before I went live. I went to download the mod and it's one of those with 4billion entries. I took the latest, and noticed someone made an "auto installer". WOOT! So I tried it, and it failed miserably.

 

No problem, I'll download the regular 2.7, and do it manually. Still no dice. Turns out, if you go to the right thread, and find the right page, you'll see folks saying "Idiot, don't use 2.7, we all use 2.1"

 

Fine. I uninstall (go backward through install instructions) 2.7 and get half way through 2.1 when I realize... these don't work with Windoze servers. /facepalm.

 

FINE... I'll just get it all out.

 

I went backward and restored all the files I could see that were modified. But now, no matter what page I go to, it pulls my index page and displays it. (sts_template.php.html) See it here: www.woodwerks.com/catalog.

 

I have a separate page for category "Cut" called index.php_30.html. It actually works. But none of my product pages work anymore.

 

I am assuming this is an SEO URL issue. Even though I've restored everything, SEO URL still shows up in my admin. Still trying to figure out how to remove that. I'm asking here, because I'm wondering if anyone (Bill :) ) could give me some clues, based on my index page showing up for all sub pages all of a sudden.

 

I really appreciate any and all help.

 

Boom

 

This wouldn't be an STS issue but I will mention this one thing.

 

If you have enabled the "Use Search Engine Friendly URLS", change it back to the default setting (False).

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

Tim, you need to understand this part of STS as it is very powerful and will open your eyes to the flexibility that STS offers in your designs.

 

View the HTML documents in the "docs" folder that came with STSv4.5.8. In there, you will see a detailed description of how you can make specific templates for specific categories/subcategories and products in specific categories, etc.

 

You may also benefit from my previous post regarding how to name these templates:

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

 

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

 

Hope that helped you out,

I have tried everything in the instuctions that came with STS and all I can seem to get is my placeholders showing at the top of the catagory page with the rest of the page having the normal layout. see here : http://upgrademycell.accountsupport.com/index.php?cPath=22

I cant find any info on how to change the content of the categories layout. I want the overall template to be the same as the rest of the site, but want to just change layout of the categores content.

Do I need to make a content template and a template like index.php_22.html? If so how do I get the two to relate to eachother? And how do I make a template that covers all categories?

 

I will start looking through the posts you reccomended, but that is so time consuming looking for one answer.

 

Thanks again,

Tim

Edited by a1sports
Link to comment
Share on other sites

I will start looking through the posts you reccomended, but that is so time consuming looking for one answer.

 

Thanks again,

Tim

 

So, you posted a reply before looking at the links that I gave you?

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 Bill,

 

I have recently installed the new one page checkout, and its a fantastic contribution, although theres very little support for it.(this is not the same as the single page checkout module I looked at before and couldnt get to work at all).

 

One page checkout works well on the normal site and sts except in sts for the change address buttons for shipping and billing.

 

The checkout page conforms to the design in sts, using infobox.php.html, however this does all the infobox's on the page for the cart, shipping, billing addresses, payment and shipping methods etc.

 

I belive thats represented by the

 buildInfobox($header, $billingAddress);

other boxes on the page are represented by the replacement of the $billingaddress for the appropirate string.

 

The code below I believe is the section in the checkout.php file thats not functioning in sts, and whilst this is for billing the same solution can be applied to the shipping address I guess once found.

 

<tr>
 <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
   <td class="main" width="50%" valign="top"><?php
	$header = TABLE_HEADING_BILLING_ADDRESS;

	ob_start();
	include(DIR_WS_INCLUDES . 'checkout/billing_address.php');
	$billingAddress = ob_get_contents();
	ob_end_clean();

	$billingAddress = '<table border="0" width="100%" cellspacing="0" cellpadding="2">
	 <tr id="logInRow"' . (tep_session_is_registered('customer_id') ? ' style="display:none"' : '') . '>
	  <td class="main">Already have an account? <a href="' . tep_href_link(FILENAME_LOGIN) . '" id="loginButton">' . tep_image_button('button_login.gif', IMAGE_LOGIN) . '</a></td>
	 </tr>
	</table>' . $billingAddress;


	buildInfobox($header, $billingAddress);
   ?><table id="changeBillingAddressTable" border="0" width="100%" cellspacing="0" cellpadding="2"<?php echo (tep_session_is_registered('customer_id') ? '' : ' style="display:none"');?>>
	<tr>
	 <td class="main" align="right"><a id="changeBillingAddress" href="<?php echo tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', $request_type);?>"><?php echo tep_image_button('button_change_address.gif', IMAGE_CHANGE_ADDRESS);?></a></td>
	</tr>
   </table></td>

 

The question is how to get the billing change address button to function within sts, hope you can help, on a side note as I dont have the ccgv module installed as I cant get that to work at all on the site I cant say if that section of the mod works in either a normal shop or on sts.

 

It would be great if this was fully integrated into sts, and I am hoping it will be very simple as it stands theres only the change address buttons to get functioning but its beyond me on how to although I have tried a few different ways to get it working but with no success.

 

Thanks

Johnny

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

So, you posted a reply before looking at the links that I gave you?

Yes I guess I did. Just didnt know if there is a quick answer rather than reading all those posts that go back to 2003.

I am usually really good t figuring this stuff out, but this one has me stumped.

Edited by a1sports
Link to comment
Share on other sites

I am finding information on making templates for indiidual products, but not categories. The instructions that came with STS talk about it but aren't all that clear how to edit the "content" of the categories, or where to put the files and have them displayed properly.

Link to comment
Share on other sites

Yes I guess I did. Just didnt know if there is a quick answer rather than reading all those posts that go back to 2003.

I am usually really good t figuring this stuff out, but this one has me stumped.

 

 

I guess you missed the point. I provided the direct "link" to the post that "provided" the answer that you needed. I will only help those who help themselves. Click on the link and read the ONE post. ;)

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 Bill,

 

I have recently installed the new one page checkout, and its a fantastic contribution, although theres very little support for it.(this is not the same as the single page checkout module I looked at before and couldnt get to work at all).

 

One page checkout works well on the normal site and sts except in sts for the change address buttons for shipping and billing.

 

The checkout page conforms to the design in sts, using infobox.php.html, however this does all the infobox's on the page for the cart, shipping, billing addresses, payment and shipping methods etc.

 

I belive thats represented by the

 buildInfobox($header, $billingAddress);

other boxes on the page are represented by the replacement of the $billingaddress for the appropirate string.

 

The code below I believe is the section in the checkout.php file thats not functioning in sts, and whilst this is for billing the same solution can be applied to the shipping address I guess once found.

 

The question is how to get the billing change address button to function within sts, hope you can help, on a side note as I dont have the ccgv module installed as I cant get that to work at all on the site I cant say if that section of the mod works in either a normal shop or on sts.

 

It would be great if this was fully integrated into sts, and I am hoping it will be very simple as it stands theres only the change address buttons to get functioning but its beyond me on how to although I have tried a few different ways to get it working but with no success.

 

Thanks

Johnny

 

If the contribution is coded correctly (in standard with osCommerce code), then STS will pick it up and everything will function properly. STS will not have any issues with the buttons (as long as the contribution is coded per osC standards).

 

If the contribution is coded poorly (use at your own risk), then STS provides a "work around". You can tell STS to exclude a PHP script from being templated.

 

See the following post regarding script exclusions:

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

 

Other than that, I can't provide support to other contributions that are not coded per osC standards.

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

If the contribution is coded correctly (in standard with osCommerce code), then STS will pick it up and everything will function properly. STS will not have any issues with the buttons (as long as the contribution is coded per osC standards).

 

If the contribution is coded poorly (use at your own risk), then STS provides a "work around". You can tell STS to exclude a PHP script from being templated.

 

See the following post regarding script exclusions:

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

 

Other than that, I can't provide support to other contributions that are not coded per osC standards.

 

Okay I understand, i have read the posts and still not sure what it is I am supposed to do.

 

I dont having anything in sts looking at the file at all, other than the infobox, how do I find out what is that osc standard?

 

Thanks

Johnny

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

I guess you missed the point. I provided the direct "link" to the post that "provided" the answer that you needed. I will only help those who help themselves. Click on the link and read the ONE post. ;)

Yes, I did get the point. For some reason when I tried them yesterday they did not go to the post directly.

 

Anyway, after my post and went to your links and I am finding information on making templates for individual products, but not categories.

The instructions that came with STS talk about it but aren't all that clear how to edit the "content" of the categories, or where to put the files and have them displayed properly.

I'm sure it's something small I am either just not seeing or I don't understand wich is frustrating because I usulally have no problem figuring this stuff out.

Thanks for your patience.

Tim

Link to comment
Share on other sites

Ok, I am making progress, after reading the links you sent me I have the template for categories working. I am only having trouble getting the "content" part to work now. Is there a content template for this like the one for products, or is there something else I should be doing?

Thanks, Tim

Link to comment
Share on other sites

Ok, I am making progress, after reading the links you sent me I have the template for categories working. I am only having trouble getting the "content" part to work now. Is there a content template for this like the one for products, or is there something else I should be doing?

Thanks, Tim

 

 

Tim,

 

You can add any "content" that you like within each category template in addition to or absence of the $content tag.

 

At this time, STS does not come with the ability to template the "content" portion of the category template pages. You would have to edit the actual script (somepage.php) itself.

 

If you know how to code PHP, you can add this category content template feature by following my steps in the following post #4325:

 

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

 

You will find it is a lot easier simply modifying the script itself. The $content tag pulls in data that is taken from the php script you are running.

 

For example, the $content for index.php is the piece of code you find in index.php, between the call of column_left

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

and the call of column_right

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

.

If you want to modify it, you have to modify the script itself (the code inbetween those to include statements).

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

Tim,

 

You can add any "content" that you like within each category template in addition to or absence of the $content tag.

 

At this time, STS does not come with the ability to template the "content" portion of the category template pages. You would have to edit the actual script (somepage.php) itself.

 

If you know how to code PHP, you can add this category content template feature by following my steps in the following post #4325:

 

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

 

You will find it is a lot easier simply modifying the script itself. The $content tag pulls in data that is taken from the php script you are running.

 

For example, the $content for index.php is the piece of code you find in index.php, between the call of column_left

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

and the call of column_right

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

.

If you want to modify it, you have to modify the script itself (the code inbetween those to include statements).

Excellent, I thik you have given me enough information to do what my client wants. I don't know how to code php from scratch, but I think I can hack my way through it. It will be a good challenge.

Thank you for your help.

Tim

Link to comment
Share on other sites

I installed the Ultra Pics 2.07.01 (2.04.1 + LightBox + CCGV + STS) contribution on an STS store, but the problem is that the additional images won't show when content product template is on.

 

 

8 hours deep, banging head against the wall, any insight would be greatly appreciated. Thanks in advance.

 

INSTALL PROCESS:

1) OVERWRITE:

>admin/categories.php

>admin/includes/languages/(Your-Language)/categories.php

>catalog/product_info.php

>catalog/popup_image.php

 

2) New files:

>catalog/includes/modules/additional_images.php

>catalog/lightbox.css

>catalog/js/builder.js (should the js folder be inserted as: catalog/includes/js/yadayada.js?)

>catalog/js/effects.js

>catalog/js/ightbox.js

>catalog/js/prototype.js

>catalog/js/scriptaculous.js

 

 

3)Run the SQL script into your database with PHPMyAdmin or other DB Manager... (double checked)

 

4) Blackness over 3/4 page: PROBLEM: duplicated Javascript commands: http://www.oscommerce.com/forums/index.php?act...ghlite=%2Bultra

 

5) Contribution works with STS OFF; Contribution works with STS in default module only; but doesn't work

with content templates: ie additional images won't show when product content template is on, but additional images show when off.

 

6) Modified $product_popup in includes/modules/sts_inc/product_info.php: http://www.oscommerce.com/forums/index.php?showtopic=289673

 

7) Checked to see if Javascript was in sts_template.html header - does this need to be inserted in another location? http://www.oscommerce.com/forums/index.php?showtopic=289673

 

Are there any steps that I am missing? Are there any modifications needed to be made to product_info.php.html?

 

http://www.sckitesurfing.com/caution2/prod...;products_id=28

 

Thanks,

Brendan

Link to comment
Share on other sites

Hi,

 

I have template.html which includes the overall layout and contains $content, $categories, and a few other variables.

 

I want to change the way login.php looks so I created a login.php.html file and placed it in the /contents/ directory. When I visit http://www.example.com/login.php shouldn't it invoke the template.html file and replace the $content var with the data that's in login.php.html?

 

Am I understanding this correctly?

Link to comment
Share on other sites

Hi,

 

I have template.html which includes the overall layout and contains $content, $categories, and a few other variables.

 

I want to change the way login.php looks so I created a login.php.html file and placed it in the /contents/ directory. When I visit http://www.example.com/login.php shouldn't it invoke the template.html file and replace the $content var with the data that's in login.php.html?

 

Am I understanding this correctly?

 

Sorry, I did not see a response: http://www.oscommerce.com/forums/index.php?s=&...t&p=1393748

 

Anyway, how do I get the login form to appear? I know I could just put $contents in the login.php.html file, but then how do I style it?

 

Basically I want to style the way the login form looks but it seems I can't have full control because there are no variables for the parts of the login form.

Edited by aceman
Link to comment
Share on other sites

I'm having same problem with $templatedir.

Does anyone know where is the problem or bug?

 

 

***BUG FIX***

 

The $templatedir placeholder would not work in some infoboxes but would in others.

 

FIX:

 

You must use end characters in your placeholders. This is a good practice anyway and it also fixes the bug above.

 

For example:

 

In your page templates, you must have the following lines before the DocType:

 

<?php DEFINE ('STS_END_CHAR', '$'); ?>
<?php DEFINE ('STS_CONTENT_END_CHAR', '$'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

 

Then...

 

You must use the beginning and ending characters with each of your placeholders:

 

 

<?php DEFINE ('STS_END_CHAR', '$'); ?>
<?php DEFINE ('STS_CONTENT_END_CHAR', '$'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html $htmlparams$>

<head>

<!--$headcontent-->

<link rel="stylesheet" type="text/css" href="$templatedir$/stylesheet.css">

</head>

 

 

This includes your body content placeholders as well:

 

$categorybox$ 
$catmenu$ 
$searchbox$ 
$manufacturerbox$ 
$informationbox$ 
$reviewsbox$

 

See Chapter 5.2.1 in the STS User Manual for more details on the Stop Character and Placeholders.

 

I will include this in the next STS release.

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

If you have IE, install the Web Developer Toolbar: Use it.

If you have Firefox, install the Web Developer add on: Use it.

 

 

OK yes, I have done that - I must say, after a week of using them, I'm quite confident, but alas, i still didn't find the problem. I'm probably missing something very simple!

 

Also, I'm starting to see some of the images displaying as "x" in the placeholders (i'm using ultrapics). Could that be just my cache maybe or?

Is there a script that works well with STS to pre-load images ?

 

Thanks for your advice.

Sol

 

www.boomclothing.com

Link to comment
Share on other sites

When I click on a category, it just brings up the index.php.html page. How do I make it bring up a page that lists all the products in the category?

 

I suppose what I could do is just remove the content/text from index.php.html and replace it with $content - but then which template file dictates what is presented on the opening/home page?

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