Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hi

 

I tried the following code below to make my site centered and fixed width with sts template and stylesheet. This worked on firefox2 but not internet explorer or firefox 3.

 

Does anybody have any suggestions to make this work?

 

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

catalog/includes/sts_templates/test/sts_template.html

 

<div id="wrapper">

 

 

catalog/stylesheet.css

 

div#wrapper {

position:relative;

margin-left:auto;

margin-right:auto;

width:1004px;

background-color: #000000;

}

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

I have installed:

Oscommerce version 2.2rc2a, STS version 4.5.8, Header Tags SEO version 3.1.5, SEO Assistant version 2.1

 

Thanks

Joey

Link to comment
Share on other sites

I have a fresh install of OSC 2.2 Online Merchant RC2, overwrote all files that came with STS (and in the RC1 folder), went to install STS in the OSC admin panel and I have no options to install! Help :(

Link to comment
Share on other sites

If you are referring to the horizontal tabs going across the top then you would either need to install a contribution to do this for you or edit the PHP yourself to get the same effect.

 

I like to use a contribution that will take the default category.php file and convert the links to a non-ordered list so that I can use CSS to style it anyway I like.

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

 

Using the above contribution, I can then use the Infobox Template feature in STS to further customize the layout of the category listing.

 

Bill I am new to osCommerce but I followed the instructinos and installed latest oscommerce, and then latest STS.

 

I followed your link to install the horizontal category, but the javascript produces an error saying that it can't find the tag "nav".

 

This is the relevant bit from the source - you will see <ul id="">.

 

<tr>

<td height="40" colspan="2" bgcolor="#00bff3"><ul id=""><li class="cat_lev_0"><a class="link_lev_0" href="http://www.spacemonkey.co.nz/catalog/index.php?cPath=1">Hardware </a>(6)<li class="cat_lev_0"><a class="link_lev_0" href="http://www.spacemonkey.co.nz/catalog/index.php?cPath=2">Software </a>(4)<li class="cat_lev_0"><a class="link_lev_0" href="http://www.spacemonkey.co.nz/catalog/index.php?cPath=3">DVD Movies </a>(17)</ul><div style="clear: both;"></td>

</tr>

 

Not quite sure what is wrong here - can you help please??

 

Thank you very much.

Link to comment
Share on other sites

Thank you Bill!

Your fix really helped me out alot.

 

Thanks again,

Karl

 

Hi, Karl & Bill,

 

I've the same problem as yours, I've the following errors when accessing login.php page:

 

Fatal error: Call to a member function on a non-object in /home/.argus/eming/ecfilm.com/catalog/includes/functions/html_output.php on line 78

 

I could not find the links Bill provided for the solution, could you pls. post the solution here, thank you.

Link to comment
Share on other sites

Hi, Karl & Bill,

 

I've the same problem as yours, I've the following errors when accessing login.php page:

 

Fatal error: Call to a member function on a non-object in /home/.argus/eming/ecfilm.com/catalog/includes/functions/html_output.php on line 78

 

I could not find the links Bill provided for the solution, could you pls. post the solution here, thank you.

 

 

Just upgrade to STSv4.5.8 and the bug fix will already be included. This bug only applied to v4.4. (tep image function).

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

This is probably very simple, but how do I get the category name to appear at the top of $content when I click on a category, instead all it says is "Let's see what we have here"

 

Andrew, I have a solution listed in the STS User Manual on how to do the exact thing that you are wanting to do. Take a look and let me know if you need help with 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

Jim,

Not caused by STS, but rather this is most likely due to how your image links have been created in your templates. You should use relative links not absolute links such as http://blah.com/images/blah.gif, make them like /images/blah.gif

 

Have to disagree with you Bill...it is STS's poor handling of paths that is the problem in cases like this...I've run across this type of thing before with STS but was able to get around it by using <?php echo $basepath ?> before any image or file calls in the pages. But i have not been able to find a way to prevent IE from giving a secure/non-secure warning for background images whose urls are defined in a css file...I think the only way to get around it is to get rid of any background image calls in the css file...instead will have to define them in the head section and use php to add the basepath to the url dynamically...there is a problem with paths caused by the extra "layer" of the template when the site has a shared ssl server...

Link to comment
Share on other sites

Have to disagree with you Bill...it is STS's poor handling of paths that is the problem in cases like this...I've run across this type of thing before with STS but was able to get around it by using <?php echo $basepath ?> before any image or file calls in the pages. But i have not been able to find a way to prevent IE from giving a secure/non-secure warning for background images whose urls are defined in a css file...I think the only way to get around it is to get rid of any background image calls in the css file...instead will have to define them in the head section and use php to add the basepath to the url dynamically...there is a problem with paths caused by the extra "layer" of the template when the site has a shared ssl server...

 

Nope, STS is not the problem but rather how STS is being used.

 

$templatedir/images/blah.gif is completely SSL safe. This example will link to blah.gif in includes/sts_templates/your_template_folder/images .

You should be using $templatedir/stylesheet.css for the path to any template specific stylesheet.css file being referenced.

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

You missed the point...the stylesheet is being found okay...but the extra layer that STS puts on the site is preventing background images from getting the proper path, so IE throws up the secure/non-secure alert box...which of course is not conducive to a good shopping flow experience...

 

if a site works fine without STS and then doesn't work with STS turned on then I'd say STS has a problem...it may be an STS config thing but I have tried everything I can think of and still have not been able to resolve this problem...note that this problem is on a site with a shared SSL server...that may be part of the problem...but STS does not handle it well...

ryan

 

Nope, STS is not the problem but rather how STS is being used.

 

$templatedir/images/blah.gif is completely SSL safe. This example will link to blah.gif in includes/sts_templates/your_template_folder/images .

You should be using $templatedir/stylesheet.css for the path to any template specific stylesheet.css file being referenced.

Link to comment
Share on other sites

You missed the point...the stylesheet is being found okay...but the extra layer that STS puts on the site is preventing background images from getting the proper path, so IE throws up the secure/non-secure alert box...which of course is not conducive to a good shopping flow experience...

 

if a site works fine without STS and then doesn't work with STS turned on then I'd say STS has a problem...it may be an STS config thing but I have tried everything I can think of and still have not been able to resolve this problem...note that this problem is on a site with a shared SSL server...that may be part of the problem...but STS does not handle it well...

ryan

Ryan,

I'm not trying to argue with you but you are not listening to my advice.

 

Use the STS tag $templatedir to link to your images (even your background images). This method does not have any issues with SSL. The tag points to your template directory and is dynamic so that you can have multiple template folders and not have to modify your links each time you change folders in the admin.

 

I strongly disagree with your statement regarding if a shop works before STS and has issues afterwards that the problem lies with STS. This is not true. You could begin with a shop that is not configured properly (but appears to work) and have faulty code (again, that appears to work) and STS will not function properly because of those underlying issues. STS requires a solid osC shop that is coded to osC standards. I understand your point but just wanted to emphasize the above as well.

 

I truley feel your image issue is a simple one and can be resolved by simply using relative links along with the proper use of the $templatedir tag. I have created several shared SSL shops with this method and had no SSL issues at all.

 

Hope this helps you out, if not, please post again and we will work it out together.

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've tried your advice Bill to no avail... I tried putting $templatedir/ in front of the background image url in the css file but that makes the background images not show at all (don't think it can handle the $templatedir var in a css file)...if my css image url is:

background-image: url(images/tile2.jpg);

then that path should be relative whether the sever is secure or not, and no non-secure items warning should ever display...but it isn't, and that is an STS thing...I have templated many osc sites manually and never run across these path problems using that method....and they are coded to "osc standards"...I admit it is a bit more work when changes to layout are made and that is why I tried STS...but in my experience and the long run it has been much simpler, faster and stable for me to do the layout templating manually...for sure it is possible that something in the configuration of my shops is not quite kosher (I've set up 30+ osc stores)...but layering a complicated app with more complications does not make my job simpler...lol...

 

I'm glad you took the time to write your mod and that it works well for many of those who use it...not everyone is a programmer and STS attemps to address this...it just hasn't worked out well for me...

thanks for your time

ryan

 

Ryan,

I'm not trying to argue with you but you are not listening to my advice.

 

Use the STS tag $templatedir to link to your images (even your background images). This method does not have any issues with SSL. The tag points to your template directory and is dynamic so that you can have multiple template folders and not have to modify your links each time you change folders in the admin.

 

I strongly disagree with your statement regarding if a shop works before STS and has issues afterwards that the problem lies with STS. This is not true. You could begin with a shop that is not configured properly (but appears to work) and have faulty code (again, that appears to work) and STS will not function properly because of those underlying issues. STS requires a solid osC shop that is coded to osC standards. I understand your point but just wanted to emphasize the above as well.

 

I truley feel your image issue is a simple one and can be resolved by simply using relative links along with the proper use of the $templatedir tag. I have created several shared SSL shops with this method and had no SSL issues at all.

 

Hope this helps you out, if not, please post again and we will work it out together.

Link to comment
Share on other sites

I've tried your advice Bill to no avail... I tried putting $templatedir/ in front of the background image url in the css file but that makes the background images not show at all (don't think it can handle the $templatedir var in a css file)...if my css image url is:

background-image: url(images/tile2.jpg);

then that path should be relative whether the sever is secure or not, and no non-secure items warning should ever display...but it isn't, and that is an STS thing...I have templated many osc sites manually and never run across these path problems using that method....and they are coded to "osc standards"...I admit it is a bit more work when changes to layout are made and that is why I tried STS...but in my experience and the long run it has been much simpler, faster and stable for me to do the layout templating manually...for sure it is possible that something in the configuration of my shops is not quite kosher (I've set up 30+ osc stores)...but layering a complicated app with more complications does not make my job simpler...lol...

 

I'm glad you took the time to write your mod and that it works well for many of those who use it...not everyone is a programmer and STS attemps to address this...it just hasn't worked out well for me...

thanks for your time

ryan

 

ryan,

 

Do not use the STS tag $templatedir inside your css file but rather use it to link to your css file. For example:

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

Then, you add the following in your css file:

background-image: url('YOURIMAGE.jpg')

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

Tried that too but didn't work...using <?php echo $basepath ?> for the css and js urls is the only thing that seems to work...where

$basepath = (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG;

 

but I'm still getting the secure/non-secure items alert in IE...can't find what else is causing that...

 

ryan,

 

Do not use the STS tag $templatedir inside your css file but rather use it to link to your css file. For example:

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

Then, you add the following in your css file:

background-image: url('YOURIMAGE.jpg')

Link to comment
Share on other sites

I need a little bit of support with this problem:

 

Some of the placeholders (and in particular $templatedir) do not work in some of the infoboxes. An example can be found here:

 

http://www.webloem.nl/projects/shop2dive/c...amp;language=en

 

In infobox.php.html i have placed a $templatedir placeholder and as you can clearly see is not translated in every infobox. I.e. Specials, Quick Find, Reviews, Shopping Cart does not work as would be expected. I've searched this forums and have found some others with this problem but no solutions yet.

 

Any advise would be great.

Link to comment
Share on other sites

Guys im trying to have that popupmod working with sts...

Nothing have worked yet, I can't figure out how to make it to work almost tried in all folders ($templatedir/ added and both files added to the therefor templatedirectory)

 

If any of you guys would help me with it, it is a very smal contrib with only 2 files and 2 lines to change within the html_output.php

I believe there is something I haven't tried yet, so let's brainstorm on this please :)

 

Dave

Light travels faster than sound. Thats why sometimes people look bright until they speak...

Link to comment
Share on other sites

Guys im trying to have that popupmod working with sts...

Nothing have worked yet, I can't figure out how to make it to work almost tried in all folders ($templatedir/ added and both files added to the therefor templatedirectory)

 

If any of you guys would help me with it, it is a very smal contrib with only 2 files and 2 lines to change within the html_output.php

I believe there is something I haven't tried yet, so let's brainstorm on this please :)

 

Dave

 

Dave, what popupmod are you trying to add? There are a ton of them.

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

Dave, what popupmod are you trying to add? There are a ton of them.

 

This one: http://addons.oscommerce.com/info/4776

You can maybe suggest me a better one if this one don't fit, I'll be glad to give a try!

 

Dave

Light travels faster than sound. Thats why sometimes people look bright until they speak...

Link to comment
Share on other sites

This one: http://addons.oscommerce.com/info/4776

You can maybe suggest me a better one if this one don't fit, I'll be glad to give a try!

 

Dave

I did not dig too deep into this but I did find the following option:

 

Take a look at this post:

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

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Does the Additional Images Module or any others work well with STS? I installed/Set Up Additional Images on STS Store (with STS) and it bombed my website... Any other image modules that work if this one doesnt? All I want really is to get 3 differen Image sizes. A thumb size, a medium size and a large Pop Up size.

 

Any help is much appreciated! Thanks

Link to comment
Share on other sites

Does the Additional Images Module or any others work well with STS? I installed/Set Up Additional Images on STS Store (with STS) and it bombed my website... Any other image modules that work if this one doesnt? All I want really is to get 3 differen Image sizes. A thumb size, a medium size and a large Pop Up size.

 

Any help is much appreciated! Thanks

Brian,

 

Take a look at UltraPics. Pick one of the version that is not bundled with another contribution.

 

Also, you will need to follow this post:

 

STS and Ultra Pics users should replace /includes/modules/sts_inc/popup_image.php with the following:

 

 

 

<?php
/*
 $Id: popup_image.php,v 1.18 2003/06/05 23:26:23 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com/"]http://www.oscommerce.com[/url]

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
// Ultrapics mods
 $products_query = tep_db_query("select pd.products_name, p.products_model, p.products_image, p.products_image_lrg, p.products_image_xl_1, p.products_image_xl_2, p.products_image_xl_3, p.products_image_xl_4, p.products_image_xl_5, p.products_image_xl_6 from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$_GET['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
 $products = tep_db_fetch_array($products_query);
 $sts->template['productname'] = $products['products_name'];
 $sts->template['productmodel'] =  $products['products_model'];

	   if ($_GET['image'] ==0) {
 $sts->template['popupimage'] = tep_image(DIR_WS_IMAGES . $products['products_image_lrg'],'','','', 'name="prodimage"');
 } elseif ($_GET['image'] ==1) {
 $sts->template['popupimage'] = tep_image(DIR_WS_IMAGES . $products['products_image_xl_1'],'','','', 'name="prodimage"');
 } elseif ($_GET['image'] ==2) {
 $sts->template['popupimage'] = tep_image(DIR_WS_IMAGES . $products['products_image_xl_2'],'','','', 'name="prodimage"');
 } elseif ($_GET['image'] ==3) {
 $sts->template['popupimage'] = tep_image(DIR_WS_IMAGES . $products['products_image_xl_3'],'','','', 'name="prodimage"');
 } elseif ($_GET['image'] ==4) {
 $sts->template['popupimage'] = tep_image(DIR_WS_IMAGES . $products['products_image_xl_4'],'','','', 'name="prodimage"');
 } elseif ($_GET['image'] ==5) {
 $sts->template['popupimage'] = tep_image(DIR_WS_IMAGES . $products['products_image_xl_5'],'','','', 'name="prodimage"');
 } elseif ($_GET['image'] ==6) {
 $sts->template['popupimage'] = tep_image(DIR_WS_IMAGES . $products['products_image_xl_6'],'','','', 'name="prodimage"');
 } elseif ($_GET['image'] ==7) {
 $sts->template['popupimage'] = tep_image(DIR_WS_IMAGES . $products['products_image'],'','','', 'name="prodimage"');
 } ?>

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

Thank you Bill,

 

I have done the install and ran the SQL file. All seemed to work well but when I get to the product_info.php page it gives me the following error...

 

1146 - Table 'modartco_install_1212413606.TABLE_ADDITIONAL_IMAGES' doesn't exist

SELECT additional_images_id, products_id, images_description, medium_images, popup_images FROM TABLE_ADDITIONAL_IMAGES WHERE products_id = '57'

[TEP STOP]

Edited by koopastomp
Link to comment
Share on other sites

Thank you Bill,

 

I have done the install and ran the SQL file. All seemed to work well but when I get to the product_info.php page it gives me the following error...

 

1146 - Table 'modartco_install_1212413606.TABLE_ADDITIONAL_IMAGES' doesn't exist

SELECT additional_images_id, products_id, images_description, medium_images, popup_images FROM TABLE_ADDITIONAL_IMAGES WHERE products_id = '57'

[TEP STOP]

 

Also in the Admin I just noticed, my categories.php page is completely blank, but when I upload my original categories.php page, it reappears

 

Any thoughts?

Link to comment
Share on other sites

OK, this problem is fixed. I had a conflicting file from a previous contribution that messed things up. My now site works like it used to before I installed this Contribution (ultrapics) but It doesn't seem to to be recognizing ultrapics in the product info pages. Fortunately the admin area is working correctly and I can upload more pics for store. but on the user-end, they don't show up. Can this be a conflict between the 2 product_info.php files, one in the root of the store and one in the includes/modules/sts_inc/ folder?

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