Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

DiamondSea

[contribution] Simple Template System (sts)

Recommended Posts

Marion,

 

A simple way to make a "text" link to another PHP file from within your store is to add the following into the HTML of your template:

<?php echo '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . 'Contact Us Link' . '</a>'; ?>

The above would add a text line "Contact Us Link" and it will link to your osCommerce "contact_us.php" file.

 

Now if you want to make an STS template for your "contact_us.php" file, simply create a HTML page and name it "contact_us.php.html". Be sure you have included the required HTML in that template. You can see what is required by looking at the "sts_blank_template.html" template in the "test" folder.

 

Once you create your "contact_us.php.html" template, the link that you added above would automatically pull up your STS version of your contact us page (contact_us.php.html).

 

You can also create a STS tag (placeholder/variable) to be used as your "contact us" text link. See my STS Tips, Tricks, and How To's in the STS4 Power Pack contribution site for more details.

 

Hope this has helped,

 

Bill Kellum

Here is another way of making that link as well:
<a href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>" class="links"><?php echo Contact Us Link; ?></a>


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
Here is another way of making that link as well:
<a href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>" class="links"><?php echo Contact Us Link; ?></a>

Sorry, that last post should have your text in quotes. Here is the correct code:

 

 

<a href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>" class="links"><?php echo "Contact Us Link"; ?></a>

You can put whatever you want for your text, just place it in the "your text here" above where you see "Contact Us Link".


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
Sorry, that last post should have your text in quotes. Here is the correct code:

 

 

<a href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>" class="links"><?php echo "Contact Us Link"; ?></a>

You can put whatever you want for your text, just place it in the "your text here" above where you see "Contact Us Link".

Thank you. I added the link you provided (it works now) and downloaded the power pack contrib files.

 

When you say (in regard to creating new html pages) "REQUIRED" html, do you mean I HAVE to utilize ALL the html that is included in the sts_template example? I still need to know if my division tags are adequate. I know nothing about tables.

Share this post


Link to post
Share on other sites
Thank you. I added the link you provided (it works now) and downloaded the power pack contrib files.

 

When you say (in regard to creating new html pages) "REQUIRED" html, do you mean I HAVE to utilize ALL the html that is included in the sts_template example? I still need to know if my division tags are adequate. I know nothing about tables.

Marion,

Take a look at the following link regarding osC and CSS:

 

http://www.oscommerce.com/community/contri...h,tableless+osc

 

STS will work with a CSS layout, you just need to make sure your osC shop is configured appropriately. The above contribution should help you with that.

 

As far as the required code, you only need the following in EACH of your template pages to make STS work on those pages:

 

1. <?php DEFINE ('STS_END_CHAR', '#'); ?>

2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

3. <html $htmlparams>

4. <head>

5.<meta http-equiv="Content-Language" content="en-us">

6. <!--$headcontent-->

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

8. </head>

 

Line 1 above defines the stop character "#" (can be anything you want such as "$") that will parse the PHP faster. If you use this line, be sure to add the stop character to each one of your tags in that template. For example; "$content" becomes "$content#". See the STS User Manual for more details.

Line 2 will be different depending upon what type of HTML validation you are using. Look up page validation on Google for more information regarding this.

Line 3 is REQUIRED as is. See STS documentation for more details.

Line 6 is REQUIRED as is. See STS documentation for more details.

Line 7 will vary depending upon your css stylesheet and its file path. If your stylesheet is not in the root of your store catalog, then specify its location here.

 

Play around with what works and doesn't but the above will get your custom templates to work with STS tags.

 

Hope this has been helpful,

Bill Kellum


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!

 

Pressing Header Tags, give always this permission problem.I tried to do chmod 777 or 775 but nothing help.

 

The following are the messages:

Permissions settings for the /hsphere/local/home/XXXXX.com/catalog/includes/header_tags.php file appear to be incorrect

Permissions settings for the /hsphere/local/home/XXXX.com <_< /osc_st/catalog/includes/header_tags.php file appear to be incorrect

 

Any suggestion will be a big help.

 

THANKS!

Edited by star8

Share this post


Link to post
Share on other sites
Marion,

Take a look at the following link regarding osC and CSS:

 

http://www.oscommerce.com/community/contri...h,tableless+osc

 

STS will work with a CSS layout, you just need to make sure your osC shop is configured appropriately. The above contribution should help you with that.

 

As far as the required code, you only need the following in EACH of your template pages to make STS work on those pages:

 

1. <?php DEFINE ('STS_END_CHAR', '#'); ?>

2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

3. <html $htmlparams>

4. <head>

5.<meta http-equiv="Content-Language" content="en-us">

6. <!--$headcontent-->

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

8. </head>

 

Line 1 above defines the stop character "#" (can be anything you want such as "$") that will parse the PHP faster. If you use this line, be sure to add the stop character to each one of your tags in that template. For example; "$content" becomes "$content#". See the STS User Manual for more details.

Line 2 will be different depending upon what type of HTML validation you are using. Look up page validation on Google for more information regarding this.

Line 3 is REQUIRED as is. See STS documentation for more details.

Line 6 is REQUIRED as is. See STS documentation for more details.

Line 7 will vary depending upon your css stylesheet and its file path. If your stylesheet is not in the root of your store catalog, then specify its location here.

 

Play around with what works and doesn't but the above will get your custom templates to work with STS tags.

 

Hope this has been helpful,

Bill Kellum

 

 

Thank you Bill; this has helped tremendously.

After looking at the tableless_css I now understand that css will work for me.

I have been looking at the sts documentation and it reads that a content folder is inside the test folder, but it isnt there. It is however in the "full" folder with the stated files "index.php_1.9.html and product_info.php_26.html. Can I just copy these files and the content folder over to the test folder?

Share this post


Link to post
Share on other sites
Thank you Bill; this has helped tremendously.

After looking at the tableless_css I now understand that css will work for me.

I have been looking at the sts documentation and it reads that a content folder is inside the test folder, but it isnt there. It is however in the "full" folder with the stated files "index.php_1.9.html and product_info.php_26.html. Can I just copy these files and the content folder over to the test folder?

The "test" folder is only meant to be used simply to test your sts installation to make sure everything works and that you have your shop configured correctly.

 

Keep in mind that you can name your template folder anything you want such as "my_templates". I would suggest you copy any of your templates that you have already modified over to either the FULL folder or a template folder that you create yourself. You will need to have two folders inside of your template folder to make sure you are utilizing STS to the fullest: a "content" folder and a "boxes" folder. I also suggest you have an "images" folder as well but that is your option. Follow the file and folder structure you see in place in the "FULL" template folder to see what you need.

 

Also: **IMPORTANT** Whatever template folder you decide to use, you will need to specify this in the "Template Folder" in your STS Modules in the admin. See my screenshot below specifying the "full" folder as my STS Template folder. STS will look for the folder name you specify in your "sts_templates" folder so your template folder must be located in this directory.

 

Hope this has helped,

 

Bill Kellum

 

sts_433_module.gif

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!

 

Pressing Header Tags, give always this permission problem.I tried to do chmod 777 or 775 but nothing help.

 

The following are the messages:

Permissions settings for the /hsphere/local/home/XXXXX.com/catalog/includes/header_tags.php file appear to be incorrect

Permissions settings for the /hsphere/local/home/XXXX.com <_< /osc_st/catalog/includes/header_tags.php file appear to be incorrect

 

Any suggestion will be a big help.

 

THANKS!

Star8, is this a new installation or something that just popped up out of nowhere? Also, what version of STS and HTC are you using? Are you using my bundled version or the two separate contributions?

 

-Bill


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
Star8, is this a new installation or something that just popped up out of nowhere? Also, what version of STS and HTC are you using? Are you using my bundled version or the two separate contributions?

 

-Bill

 

Sorry for the disturbance. The problem is solved. Is it correct that catalog/includes/headertags.php and catalog/includes/languages/english/headertags.php should be on chmod 777? This is what I did once again that's why it worked.

Share this post


Link to post
Share on other sites
Sorry for the disturbance. The problem is solved. Is it correct that catalog/includes/headertags.php and catalog/includes/languages/english/headertags.php should be on chmod 777? This is what I did once again that's why it worked.
Yes, that is correct. Glad it is working for you. :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

Hi Everyone,

 

Pretty much completely new to osCommerce and STS...

I have had a quick search for the answer already but please feel free to pint me in the right direction...

 

Anyway, what I am after is some information on how I can customise the TOP views.

 

I.e. is it possible to alter how "$content" is rendered?

 

 

I.e. if I choose a category name I get a vertical listing of all items in the chosen category, how do I alter the display so that it is for example "tiled"?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

:D NEW BUNDLE ADDED...

 

For those that are interested, I have posted an updated version of my STS and HTC bundle contribution. This bundle includes the latest Simple Template System version 4.3.3 intergraded with the latest version of the Header Tags Controller version 2.6.0. This bundle is a complete version of both of these contributions, just intergraded into one seamless install plus a handy User Manual that covers both contributions. **I’ve had those that just use HTC by itself find this User Manual useful.

 

:blink: I am no longer posting this bundle on the STS contribution site to help avoid confusion for those who wish to download the latest version of STS by itself. ;)

:thumbsup: You can now find this bundle, in addition to tutorials and tips, on the STS4 Power Pack contribution site. (http://www.oscommerce.com/community/contributions,4456)

I will continue to update the STS & HTC bundle as the need arises.

Hope you find this useful.


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 am still trying to understand how STS works. I am using the latest package. Now my questions are:

1) I activated the sts_template.html and it shows the background, which I only wanted it as body background but not inside the content background. I placed the image only at body background, and have another background color in fixed at stylesheet.css. How do I keep the background only in the body, meaning around it, and not inside the content.

 

2) Where do you define $content# placeholder if you want to change the definition of it?

3) Generally, where do I change the definitions of these placeholders?

 

Thanks :blush:

Edited by star8

Share this post


Link to post
Share on other sites

I have a question about $content layout when it comes to the categorybox. I have a template that I'm using for the categorybox only (ie: infobox_categories.php.html) and for some reason there's a weird problem with alignment. The $content won't align with the top of my infobox. There's a huge gap no matter what I do. Anyone know how I can fix this? (See image below)

 

problem.jpg

Share this post


Link to post
Share on other sites

Hi there...

 

is there a possibility to make a template for a specific category or subcategory?

eg the cat. software got template 1 and hardware got template 2?

Thanx for help!!

Share this post


Link to post
Share on other sites
Hi there...

 

is there a possibility to make a template for a specific category or subcategory?

eg the cat. software got template 1 and hardware got template 2?

Thanx for help!!

Absolutely! This is very easy to do with STS. Look in the User Manual for details on how to create templates for specific categories, products, infoboxes and more.

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 am using the stylesheet.css of basic program pack and also the latest STS package, now the problem is the .fixcenter in the stylesheet.css is not reacting with STS package. It takes the whole background-image throughout the page, I want it just around the page. How do I do it?

 

Thanks :(

Share this post


Link to post
Share on other sites

Ok I can't semm to get STS 4.3 configured properly.When you go to admin panel and modules the STS modules isn't shwong up??? Does anyone know how to fix this?????

Share this post


Link to post
Share on other sites
Ok I can't semm to get STS 4.3 configured properly.When you go to admin panel and modules the STS modules isn't shwong up??? Does anyone know how to fix this?????
Amy, I posted a response to this in the STSv4 forum.

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
Guest

I'm using STS 3.

 

I can only get certain functions like downloads and product availability to show up when I delete the product_info.php.html file in the sts_templates folder.

 

Has anyone else had this problem and solved it?

Share this post


Link to post
Share on other sites

I had a problem with enlarging the image. The Click to Enlarge Image link was not working. I have solved the problem and would like to make note that if anyone else comes across this issue, make sure that in the head tags of the tempalte (in my case i used sts_template) you enclose the following java script:

 

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>

 

Hope this may help anyone

Share this post


Link to post
Share on other sites

hi guys

i am using the latest sts with htc.everything is working fine.just one last annoying thing .i cant seem to finger out ..

How do u define the #url<wateever> shortcut.i know how to add stuff to sts_user_code.php

 

i created two button my account and help.My account i got href to <?=tep_href_link('contact_us.php')?> and it works..the help button i want to link to informationbox but i dont want to use $informationbox.how do i create $urlinformationbox or can i.Is there another way i get the informationbox contents to be displayed on the page

 

hope this makes sense

 

ta

Share this post


Link to post
Share on other sites
Guest

You can do same as for contact_us.php, but with another php file. Now, I don't know which php file as you only speak about the information box, and the information box contains links to several files, so which one you want to link to?

Share this post


Link to post
Share on other sites
You can do same as for contact_us.php, but with another php file. Now, I don't know which php file as you only speak about the information box, and the information box contains links to several files, so which one you want to link to?

 

 

thnaks for looking at this

 

i know i can call individual files like privacy and shiping and the others.But what i am looking for is a way to call the information box through a help button on my site.

so when the visitor clicks on the help buttons he gets something similar to this http://www.eclipsecomputers.com/help.aspx?type=1 .where the box gets displayed on the left and in the middle u can get normal contact info..

 

Hope this makes sense..

 

many thanks

Share this post


Link to post
Share on other sites
thnaks for looking at this

 

i know i can call individual files like privacy and shiping and the others.But what i am looking for is a way to call the information box through a help button on my site.

so when the visitor clicks on the help buttons he gets something similar to this http://www.eclipsecomputers.com/help.aspx?type=1 .where the box gets displayed on the left and in the middle u can get normal contact info..

 

Hope this makes sense..

 

many thanks

Why don't you just create a template for the Contact Us page and include the information infobox in the left column? You could create the link from your help button to the Contact Us page which would then call up your Contact Us template page.

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

×