Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

STS Template Problem Using Table with $content inside

 

I am really happy to have found the STS Template SYSTEM, so first of all thanks for this GREAT contribution :thumbsup:

 

Inside of my different template files everything looks really nice except for that the table border color that is surrounding the $content part in the middle, doesn?t get streached..so the left and right table color/pixel isn?t working.

 

This is how it looks:

index_problem.gif

 

 

Below is the html code, can?t be that hard to get a boarder around the table that adjust to the content ? II haver tried for days w/o any success

 

Best regards tom tom (at) redbull.nu

 

 

 

 

 

 

<td align="center" valign="top" width="482">

<table width="480" border="0" cellspacing="0" cellpadding="0" align="center">

<tr align="right">

<td colspan="2" align="left" width="480">

<table width="482" border="0" cellspacing="0" cellpadding="0" height="153">

<tr height="110">

<td colspan="3" align="left" valign="top" width="482" height="110">$dynamic_welcome</td>

</tr>

<tr height="43">

<td align="left" valign="top" width="92" height="43"><a href="http://www.mydomain.com/login.php"><img src="http://www.mydomain.com/images/index/index_loggain.jpg" alt="" height="33" width="92" border="0"></a></td>

<td align="left" valign="top" width="101" height="43"><a href="http://www.mydomain.com/login.php"><img src="http://www.mydomain.com/images/index/index_24store.jpg" alt="" height="33" width="101" border="0"></a></td>

<td align="left" valign="top" width="289" height="43"><img src="http://www.mydomain.com/images/index/index_1.1.jpg" alt="" height="33" width="289" border="0"></td>

</tr>

</table>

</td>

</tr>

</table>

<table width="482" border="0" cellspacing="0" cellpadding="0">

<tr>

<td align="left" valign="top" width="241">$dynamic_ad_index1</td>

<td align="right" valign="top" width="241">$dynamic_ad_index2</td>

</tr>

</table>

Edited by Prince Tom
Link to comment
Share on other sites

Grrrrrrrr......sorry friends but the correct html code to the above message should be:

 

 

 

 

 

<table border="0" cellspacing="0" cellpadding="0">

<tr height="8">

<td align="left" valign="top" width="7" height="8"><img src="http://www.mydomain.com/images/table/horn_top1.gif" alt="" height="8" width="7" border="0"></td>

<td width="466" height="8"><img src="http://www.mydomain.com/images/table/top.gif" alt="" height="8" width="466" border="0"></td>

<td align="right" valign="top" width="7" height="8"><img src="http://www.mydomain.com/images/table/horn_top2.gif" alt="" height="8" width="7" border="0"></td>

</tr>

<tr>

<td align="left" width="7"> <table width="2" border="0" cellspacing="0" cellpadding="0" height="100%">

<tr>

<td bgcolor="#efefef" width="1"><img src="http://www.mydomain.com/images/pixel_trans.gif" alt="" height="10" width="1" border="0"></td>

<td bgcolor="#bfc2c4" width="1"><img src="http://www.mydomain.com/images/pixel_trans.gif" alt="" height="10" width="1" border="0"></td>

</tr>

</table></td>

<td valign="top" width="466">$content</td>

<td align="right" width="7"> <table width="2" border="0" cellspacing="0" cellpadding="0" height="100%">

<tr>

<td bgcolor="#efefef" width="1"><img src="http://www.mydomain.com/images/pixel_trans.gif" alt="" height="10" width="1" border="0"></td>

<td bgcolor="#bfc2c4" width="1"><img src="http://www.mydomain.com/images/pixel_trans.gif" alt="" height="10" width="1" border="0"></td>

</tr>

</table></td>

</tr>

 

<tr height="8">

<td height="8"><img src="http://www.mydomain.com/images/table/horn_bottom1.gif" alt="" height="8" width="7" border="0"></td>

<td height="8"><img src="http://www.mydomain.com/images/table/bottom.gif" alt="" height="8" width="466" border="0"></td>

<td height="8"><img src="http://www.mydomain.com/images/table/horn_bottom2.gif" alt="" height="8" width="7" border="0"></td>

</tr>

</table>

Link to comment
Share on other sites

I love the idea of customizing osCommerce to fit my site. However, when I view my completed page, I see the fieldnames, instead of the data... For instance, instead of seeing the title, I see $title. I'm sure its an easy fix, I'm just not an expert with PHP coding... I'm not even close. lol

 

thanks.

Melanie

[talktomeonline.com]

Link to comment
Share on other sites

Are you sure you uploaded all the files and added the STS lines to your config file?

 

I love the idea of customizing osCommerce to fit my site.  However, when I view my completed page, I see the fieldnames, instead of the data...  For instance, instead of seeing the title, I see $title.  I'm sure its an easy fix, I'm just not an expert with PHP coding...  I'm not even close. lol

 

thanks.

Melanie

[talktomeonline.com]

Link to comment
Share on other sites

Hi,

 

This may have been answered before and it also may have nothing to do with the sts but which file contains the padding information that seperates the infoboxes?

 

Thanks

 

Mark :-"

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

I could be a mile off here - but are you pointing your browser at your template page or the OSC index page?

 

If you are using the following url (or something similar):

 

talktomeonline.com/catalog/includes/sts_template.html *** ADULT ***

 

Then you will probably see lots of $variables there because this is your base template.

 

If you use the normal url to your shop home page:

 

talktomeonline.com/catalog/index.php *** ADULT ***

 

Then this will pick up your sts_template.html and use it by replacing your '$variables' with content.

 

If you see neither, then you must go through the install again

 

Hope that helps

 

 

I love the idea of customizing osCommerce to fit my site.  However, when I view my completed page, I see the fieldnames, instead of the data...  For instance, instead of seeing the title, I see $title.  I'm sure its an easy fix, I'm just not an expert with PHP coding...  I'm not even close. lol

 

thanks.

Melanie

[talktomeonline.com]

Link to comment
Share on other sites

Okay guys... Thanks for your replies. It was actually something really dumb.... Dreamweaver, for some reason, was not actually uploading my files once I edited them. So, once I figured that out, I just uploaded the files using my ftp program and voila!!

 

Now... Another question. I have my template well on its way to fitting perfectly with my site design. The only thing is that I'm changing all the font sizes, colors, and faces to match my site design, this is turning into a huge project because I don't know where to go to change them for each of the different boxes. I was able to figure out the $content section, but the rest have me boggled. Anyone have any ideas? I'm just using the default boxes that came with the sts_template.html page, nothing more, so I just need those.

 

Thanks.

Melanie

 

WARNING: [www.talktomeonline.com] is an ADULT site, so if you're offending by ADULT orientated material, please don't click...

 

[talktomeonline.com]

 

 

I could be a mile off here - but are you pointing your browser at your template page or the OSC index page?

 

If you are using the following url (or something similar):

 

talktomeonline.com/catalog/includes/sts_template.html *** ADULT ***

 

Then you will probably see lots of $variables there because this is your base template.

 

If you use the normal url to your shop home page:

 

talktomeonline.com/catalog/index.php *** ADULT ***

 

Then this will pick up your sts_template.html and use it by replacing your '$variables' with content.

 

If you see neither, then you must go through the install again

 

Hope that helps

 

 

QUOTE(melaniegosselin @ Nov 19 2004, 04:33 PM)

I love the idea of customizing osCommerce to fit my site.  However, when I view my completed page, I see the fieldnames, instead of the data...  For instance, instead of seeing the title, I see $title.  I'm sure its an easy fix, I'm just not an expert with PHP coding...  I'm not even close. lol

 

thanks.

Melanie

[talktomeonline.com]

*

 

 

mark27uk3  Posted Yesterday, 08:21 AM

 

Hi,

 

This may have been answered before and it also may have nothing to do with the sts but which file contains the padding information that seperates the infoboxes?

 

Thanks

 

Mark whistling.gif

charmdiva  Posted Yesterday, 01:42 AM

  Are you sure you uploaded all the files and added the STS lines to your config file?

 

QUOTE(melaniegosselin @ Nov 19 2004, 05:33 AM)

I love the idea of customizing osCommerce to fit my site.  However, when I view my completed page, I see the fieldnames, instead of the data...  For instance, instead of seeing the title, I see $title.  I'm sure its an easy fix, I'm just not an expert with PHP coding...  I'm not even close. lol

 

thanks.

Melanie

[talktomeonline.com]

*

 

 

melaniegosselin  Posted Yesterday, 01:33 AM

  I love the idea of customizing osCommerce to fit my site. However, when I view my completed page, I see the fieldnames, instead of the data... For instance, instead of seeing the title, I see $title. I'm sure its an easy fix, I'm just not an expert with PHP coding... I'm not even close. lol

 

thanks.

Melanie

[talktomeonline.com]

Link to comment
Share on other sites

This knowledge base article helped me a lot:

 

http://www.oscommerce.info/kb/osCommerce/C...n_and_Layout/54

 

 

Okay guys... Thanks for your replies.  It was actually something really dumb....  Dreamweaver, for some reason, was not actually uploading my files once I edited them.  So, once I figured that out, I just uploaded the files using my ftp program and voila!!

 

Now... Another question.  I have my template well on its way to fitting perfectly with my site design. The only thing is that I'm changing all the font sizes, colors, and faces to match my site design, this is turning into a huge project because I don't know where to go to change them for each of the different boxes.  I was able to figure out the $content section, but the rest have me boggled.  Anyone have any ideas? I'm just using the default boxes that came with the sts_template.html page, nothing more, so I just need those.

 

Thanks.

Melanie

 

WARNING:  [www.talktomeonline.com] is an ADULT site, so if you're offending by ADULT orientated material, please don't click...

 

[talktomeonline.com]

Link to comment
Share on other sites

Anyone who can help me, just installed Simple Template System (STS) v2.01

 

But now Im trying to install Specials on Default 2.0

 

But I cant seem to find out where I shall include the code, have installed it in Index.php but that isnt used by this cool template system.

 

Anyone who can help me out and tell me how and where to add the code so that I can show more on the mainpage

 

Thanks in advance

Link to comment
Share on other sites

Anyone who can help me, just installed Simple Template System (STS) v2.01

 

But now Im trying to install Specials on Default 2.0

 

But I cant seem to find out where I shall include the code, have installed it in Index.php but that isnt used by this cool template system.

 

Anyone who can help me out and tell me how and where to add the code so that I can show more on the mainpage

 

Thanks in advance

 

Ok fixed it, but now I have another problem. Im trying to setup a special offer on the mainpage, but would like it to be above the latest products. But if I put the code before $content it shows up before the text on the mainpage and it should be between the text and latest products

 

anyone who has any idears to fix this ??

Link to comment
Share on other sites

Hi all. Great contribution. :thumbsup:

 

I'd like to hack this just slightly so that if index.php uses a special template (index.php.html), but if index.php/cPath/21, for example, or any other category page is called that it uses the default template. Does that make sense?

 

Can I mod this code to do that?

 

// Start with the default template
$sts_template_file = STS_DEFAULT_TEMPLATE;

// See if there is a custom template file for the currently running script
$sts_check_file = STS_TEMPLATE_DIR . $scriptbasename . ".html";
if (file_exists($sts_check_file)) {
 // Use it
 $sts_template_file = $sts_check_file;
} 

// Are we in the index.php script?  If so, what is our Category Path (cPath)?
if ($scriptbasename == "index.php") {
 // If no cPath defined, default to 0 (the home page)
 if ($cPath == "") {
$sts_cpath = 0; 
 } else {
       $sts_cpath = $cPath;
 }

 // Look for category-specific template file like "index.php_1_17.html"
 $sts_check_file = STS_TEMPLATE_DIR . "index.php_$sts_cpath.html";

 if (file_exists($sts_check_file)) {
   // Use it
   $sts_template_file = $sts_check_file;
 } 

}

 

If anyone can help I'd be grateful. Thanks.

Link to comment
Share on other sites

Hi all. Great contribution.  :thumbsup:

 

I'd like to hack this just slightly so that if index.php uses a special template (index.php.html), but if index.php/cPath/21, for example, or any other category page is called that it uses the default template. Does that make sense?

 

Can I mod this code to do that?

 

// Start with the default template
$sts_template_file = STS_DEFAULT_TEMPLATE;

// See if there is a custom template file for the currently running script
$sts_check_file = STS_TEMPLATE_DIR . $scriptbasename . ".html";
if (file_exists($sts_check_file)) {
 // Use it
 $sts_template_file = $sts_check_file;
} 

// Are we in the index.php script?  If so, what is our Category Path (cPath)?
if ($scriptbasename == "index.php") {
 // If no cPath defined, default to 0 (the home page)
 if ($cPath == "") {
$sts_cpath = 0; 
 } else {
       $sts_cpath = $cPath;
 }

 // Look for category-specific template file like "index.php_1_17.html"
 $sts_check_file = STS_TEMPLATE_DIR . "index.php_$sts_cpath.html";

 if (file_exists($sts_check_file)) {
   // Use it
   $sts_template_file = $sts_check_file;
 } 

}

 

If anyone can help I'd be grateful. Thanks.

 

Here's what I did (in case anyone is interested). I can't promise that it's eloquent, but it seems to do the trick.

 

  if ($sts_cpath != "") {
$sts_template_file = STS_DEFAULT_TEMPLATE;
 } else {
$sts_template_file = STS_TEMPLATE_DIR . "index.php.html";

}

Link to comment
Share on other sites

Reply if you want to help a stupid newbie.

 

Sorry for asking such a dumb question, but any help would be apprediatedas I'm a total PHP/CSS newbie. I 'THINK' I've installed this correctly as the appearance of my site changed once I did (www.partymaniaonline.com). Now how do I go about modifying the background colors of boxes? I'm sure this is REALLY basic, but I'm not sure what exactly to change.

 

Thanks for any help!

Link to comment
Share on other sites

Hi Guys,

 

Which thumbnail contrib would you recommend to use with sts, I have tried the 'Auto Thumbnailer with GD Support' and the 'Thumbnails & Watermarks On The Fly' contribs and neither of them seem to work with sts.

 

I would prefer to use the 'Auto Thumbnailer with GD Support' if I can as I have used this contrib before.

 

Any advice from the people who have been there and done that would be appreciated.

 

Thanks

 

Mark :thumbsup:

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Open styles.css and then take a look at this knowledge base article:

 

http://www.oscommerce.info/kb/osCommerce/C...n_and_Layout/54

 

It should help you figure out what styles you need to change.

 

 

Reply if you want to help a stupid newbie. 

 

Sorry for asking such a dumb question, but any help would be apprediatedas I'm a total PHP/CSS newbie.  I 'THINK' I've installed this correctly as the appearance of my site changed once I did (www.partymaniaonline.com).  Now how do I go about modifying the background colors of boxes?  I'm sure this is REALLY basic, but I'm not sure what exactly to change.

 

Thanks for any help!

Link to comment
Share on other sites

Have just installed STS and works it great except that the main part of the shop ($content) is blank. Anyone who could tell what could have caused this?

 

Also the Center Shop doesn't work. Can the lacking $content somehow be due to the installation of Centershop?

 

Cheers / Mogens

Link to comment
Share on other sites

You dont need to use any contribution that centers the shop, all you need to do is center all the tables in the sts_template.html file in your preffered html editor!

 

Mark

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

Hi Guys,

 

Which thumbnail contrib would you recommend to use with sts, I have tried the 'Auto Thumbnailer with GD Support' and the 'Thumbnails & Watermarks On The Fly' contribs and neither of them seem to work with sts.

 

I would prefer to use the 'Auto Thumbnailer with GD Support' if I can as I have used this      contrib before.

 

Any advice from the people who have been there and done that would be appreciated.

 

Thanks

 

Mark :thumbsup:

 

I have used the on the fly contrib, check with your host which GD version they use (i think you can check it via admin-->tools-->server) Not all hosts have it installed.

Make sure you download the 1.5 of the original creator Nate Welch.

When I did it, it didnt work either, but found out via my host I had a parse error somewhere. Make sure you can check errors as sometimes (as on my host) it doesn't show untill they check their error reporting.

 

Let me know if you have any particulair problems.

 

Giovanna

Link to comment
Share on other sites

Please someone help with this: I wrote earlier that the $content part was empty. I have then deleted all files from my test area, re-installed oscommerce, copied files from another of my working shops, and restored the database. Same story: Empty main area! :(

Any ideas as I cannot see what to do next (I have of course tested that the shop worked before adding the STS contribution).

 

Mogens

Link to comment
Share on other sites

I would start with the most obvious possibilities. When you put the $content variable within your template, did you spell it correctly? Is your template in the includes directory?

 

Please someone help with this: I wrote earlier that the $content part was empty. I have then deleted all files from my test area, re-installed oscommerce, copied files from another of my working shops, and restored the database. Same story: Empty main area! :(

Any ideas as I cannot see what to do next (I have of course tested that the shop worked before adding the STS contribution).

 

Mogens

Link to comment
Share on other sites

Debbie : Yes, it is spelled correct as "$content". In fact I have not modified anything yet, so everything (except the changes in configure.php) have been taken straigth from the contribution and placed under /includes.

 

When selecting a category or an information item, I can see the top line change to for example "Top ? Catalog ? Terms of trade" from "Top ? Catalog" but unfortunately nothing displayed visible in the main area. Could this indicate that this is a display issue (something that makes this variable invisible)?

 

Thanks for your help :D

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