Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Hi there, i'm trying to figure out how to use the get_javascript function in STS, in order to add google analytics support, i might create a contribution to that too, simplifying the process.

 

The question is : where to put the code for it to show in the "application2header" part of the template's source ?

 

Cheers !

 

Terence

 

This is all done automatically by using the $headcontent tag.

 

$headcontent

 

This placeholder is very important in the template. It takes care of html meta tags and javascript that are to be placed in the html header of the page.

It will place the following in your template:

- http-equiv meta tag with charset

- title meta tag (from $headertags)

- base URL

- Javascript found in includes/header.php

How to Use: Place <!--$headcontent--> between <head> and </head> of your template. It is important to keep the comment chars before and after $headcontent otherwise it won't work!

Example:

<head>
<!--$headcontent-->
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

Result of the example:

 

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>This is the title of my store</title>
<base href="[url="http://mystore.com/"]http://mystore.com/[/url]">
<!-- start get_javascript(applicationtop2header) //-->

<!-- end get_javascript(applicationtop2header) //-->
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

 

Created in: includes/classes/sts.php

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,

 

Appreciate all your work here.

 

I use STS and I am having a problem with text in my site. When I first started, all text used to 'wrap' if I inputted it in the admin or in the html part of the site. However, recently I've noticed that text will not wrap itself anymore. I have to manually insert <br> tag at the end of each line so that it returns to a new line. I was wondering where the wrap part of the code was in STS so that I can go and check it and make sure that I haven't gone and deleted it by accident whiole making changes.

 

Thanks again for all your help on this site.

 

Regards,

 

Tomo

 

It appears you may have deleted a </td> or </tr> tag in one of your tables if you are using tables. This may also be a CSS issue. Either way, the problem lies within your template.

 

I'm not sure what you mean by "inputted it in the admin". Are you using some type of HTML editor add-on for osCommerce?

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,

 

Where should I put the Google Adwords code to track sales in my shop, when I'm using STS?

 

Hope some can help me

 

Best regards,

 

Jesper Brejning

www.BabyGear.dk - Kids on the go!

 

Hello Jesper

 

I have google analitics and adsense which I would guess is used in the same way as adwords.

 

I simply cut&paste the code for each and put it where i wanted in the sts_template.html file.

I put analitics at the very bottom after the closing body and html tags.

 

MatthewJohnRitchie

Link to comment
Share on other sites

What am I trying to achieve? --- a front page that determins which domain name has been used to make the call to the server and outputs an individual style of template for that domain name.

 

What was I trying to do above? --- remove the dynamenu links from the bottom of the screen.

 

Now there are two ways that this could work...

 

first is to have a query statement in the index file that says use this code[1] for domain[1] or code[2] for domain[2] etc. hence the application_bottom.php include could be allowed in [1] and not [2] thus dynamenu links would not show in [2].

 

second - sts_template.html, I believe would need a similar domain name identifier statement to provide different templates for each domain.

 

Finally I have a working solution.

 

If any sts users would like to use diferent templates for different domain names then this is how I have done it:

 

GOTO:

 

[1] --- http://www.bluegreenenterprises.com/OSC_TE...a/rc1_GCOv145a/

 

[2] --- http://www.bluegreentechnologies.com/OSC_T...a/rc1_GCOv145a/

 

 

[1] is the normal default template and [2] is a individual template for the domain www.bluegreentechnologies.com

 

p.s. This only works in my test environment at the above addresses. If you click the logo you are now under the control of a different sts installation.

 

THE CODE:

 

IN STS_TEMPLATE.HTML:

 

<?PHP

 

IF(!($_SERVER['SERVER_NAME'] == 'www.bluegreenenterprises.com')){

 

include('bgt_template.php');

 

}else{

 

include('bge_template.php');

 

} // end ifelse not bluegreenenterprises.com

 

?>

 

AND IN THE TWO INCLUDE FILES I HAVE THE NORMAL AND ALTERED TEMPLATE CODE WITH NO ADDITIONS OUTSIDE THE DOCTYPE.

 

Thats it for now....

 

OH! playing around with the shop index with if statements to load different shop content doesnt work ;o) I have tried it....

 

to resolve the dynamenu thing you still need to inclued $dm_header, you can ignore any menu items etc if you wish but to avoid the mess at the bottom of the page you need the header.

 

this has the benifit of being able to creat other dynamic menus for other domains....

 

 

MatthewJohnRitchie

Link to comment
Share on other sites

In addition to my post above:

 

If you want redirects using php for different domain names as well as the different templates then in:

 

www.yourname.com/index.php (the first indexfile to be loaded when all there is in the url is www.yourname.com)

 

above everything put:

 

#####################################################

 

<?php

 

IF($_SERVER['SERVER_NAME'] == 'www.bluegreenenterprises.com'){

 

header("Location: http://www.bluegreenenterprises.com/ebusiness_info/index.php");

exit;

}elseIF($_SERVER['SERVER_NAME'] == 'www.diywind.co.uk'){

 

header("Location: http://www.diywind.co.uk/Company/About_Us.php");

exit;

}

 

/*

$Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

 

#####################################################

 

NOW YOU HAVE:

 

REDIRECTS TO THE RIGHT FILES

 

&&&

 

A DIFFERENT TEMPLATE FOR EVERY DOMAIN NAME

 

..............................

 

 

All I need now is a way to block users from one domain entering pages under the second domain_name url.....

 

any ideas.

 

MatthewJohnRitchie

Edited by MatthewRitchie
Link to comment
Share on other sites

You might ask why do all this....

 

Google (as far as I know) does not like server redirects and I only have one server which several domains share. They are all under my control so I dont mind them sharing.

 

but i do want differnt front pages showing for each domain.

 

Matthew

Link to comment
Share on other sites

Hello, all! I am having a slight issue with my store. I have popup images enabled, but even with them not (in STS), I am unable to get a popup window when clicking to enlarge an image on the products page. I wanted to install lightbox, so I tried that as well, and just the same...it still won't enlarge the image when clicked on. Any ideas? Much appreciated! :)

 

Cameron

Link to comment
Share on other sites

Hey, all. I've investigated this further and have found that the problem lies somewhere in my css or html file, I just can't tell where. If I change the STS to be directed to the demonstration folders included in it's package, then the popup works fine. Anyone have any ideas as to what could cause a conflict in a CSS file?

Link to comment
Share on other sites

I installed STS and want to get started making a template. I read that you can do it in one file but I'm not exactly sure what to do. I know some html but that's about it and from what I read you can edit in one file: sts_template.html. So I open sts_template.html in dream weaver and do what? Editing the page properties does nothing as well as changing the colors of the tables. I would also like to create some buttons for some of the option but I do not see how I can using the place holders. So I guess can someone tell me how to edit the template using html and how to create linkable buttons.

 

If there is a tutorial out there that would explain it that would be great too.

Link to comment
Share on other sites

I installed STS and want to get started making a template. I read that you can do it in one file but I'm not exactly sure what to do. I know some html but that's about it and from what I read you can edit in one file: sts_template.html. So I open sts_template.html in dream weaver and do what? Editing the page properties does nothing as well as changing the colors of the tables. I would also like to create some buttons for some of the option but I do not see how I can using the place holders. So I guess can someone tell me how to edit the template using html and how to create linkable buttons.

 

If there is a tutorial out there that would explain it that would be great too.

 

Hello,

Keep in mind, STS will not do EVERYTHING for you; you will still need to know HTML. You should be seeing your changes that you made to the default template (sts.template.html) as long as you have turned on STS in your store's admin under "modules".

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

Well I do know HTML but apparently that is not enough. Knowing HTML isn't giving me any ideas as to how to create image buttons for one thing. Exactly how would you go about linking to the different pages using the STS system? How to I create a graphic link? These are things that I know how to create in HTML but that does me little good trying to do it with STS.

Edited by overbound
Link to comment
Share on other sites

Hello, all! I am having a slight issue with my store. I have popup images enabled, but even with them not (in STS), I am unable to get a popup window when clicking to enlarge an image on the products page. I wanted to install lightbox, so I tried that as well, and just the same...it still won't enlarge the image when clicked on. Any ideas? Much appreciated! :)

 

Cameron

 

If the popup image is working with the sample templates (the templates that I provided in the STS download), then the reason it is not working in your custom template is because you did not insert the STS tag to do so.

 

$headcontent

 

You would have answered your own question if you would have read just a few posts above yours (#4934). Sorry, I just get a little tired of answering the same questions all of the time. :blink:

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

Well I do know HTML but apparently that is not enough. Knowing HTML isn't giving me any ideas as to how to create image buttons for one thing. Exactly how would you go about linking to the different pages using the STS system? How to I create a graphic link? These are things that I know how to create in HTML but that does me little good trying to do it with STS.

 

Bryce,

Since you are just starting out with osCommerce and STS, it is possible that you did not install STS correctly. You may also be trying to modify the wrong sts.template.html file. STS comes with two sample template folders. You should play around with the "full" folder to play around with the page & infobox templates until you feel comfortable enough to create your own template. I have tutorial on my site if you are still needing some basic help. As far as the image map is concerned, it is no different than creating an image map for any other HTML page. A few posts up I discussed how to make a link to a category or a product. The knowledge base in this forum tells how to make a link to specific pages in your shop.

 

Hope this helped,

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 have STS installed on my site, and a I to show all the products from the category under a the product info. Is that possible? I kwow there is a addon to do this, only I don't know to use it with STS, so I thought may be somebody can send me on the way..

Addon: http://addons.oscommerce.com/info/6392

Tanx

 

STS will pick up the add-on automatically as long as the add-on didn't create a new infobox. In that case, all you would need to do is create a STS tag for the new infobox.

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,

Is there an other way to show all the products in the category under the product info?

Dirk

Dirk,

 

The best and easiest way to accomplish this would be to install the All Products contribution. STS will automatically pick up the add-on.

 

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

 

or

 

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

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

  • 3 weeks later...

I know this is probably covered in this thread somewhere, and I will keep reading it even tho its giving me a headache <_<

 

But I'm trying to find a way to put the Log Out option on the home page...at this point... ANYWHERE!

I am trying to test the shipping options for domestic and Int'l but can't log out of one account to sign in with another.

 

PLEASE HELP!!!! :blush:

Link to comment
Share on other sites

I know this is probably covered in this thread somewhere, and I will keep reading it even tho its giving me a headache <_<

 

But I'm trying to find a way to put the Log Out option on the home page...at this point... ANYWHERE!

I am trying to test the shipping options for domestic and Int'l but can't log out of one account to sign in with another.

 

PLEASE HELP!!!! :blush:

 

STS already comes with a pre-defined tag that will do exactly what you are wanting (see the STS User Manual for a list of all of the pre-defined tags and what they do).

 

See post# 4631 in the STSv4 Support Thread.

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

 

Hope this 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

STS already comes with a pre-defined tag that will do exactly what you are wanting (see the STS User Manual for a list of all of the pre-defined tags and what they do).

 

See post# 4631 in the STSv4 Support Thread.

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

 

Hope this helped you out,

 

Thank you so much! I actually found the code and where to edit it on another thread (Badeziner GG9 Template - Add Log Out to header), probably not even for the template I'm using since I wasn't the only person working on this site years ago and have no clue what exactly was done, but took a chance and it worked!

 

Thanks again ~

Link to comment
Share on other sites

Thank you so much! I actually found the code and where to edit it on another thread (Badeziner GG9 Template - Add Log Out to header), probably not even for the template I'm using since I wasn't the only person working on this site years ago and have no clue what exactly was done, but took a chance and it worked!

 

Thanks again ~

That would work of course but you didn't have to "re-invent the wheel" just to get a logout for your Simple Template System template. The tags are already available so it would be as simple as just inserting one of the logout tags inside your template where you wanted the text to appear.

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

Hello People.

 

I have an odd problem with the currency dropdown.

 

I have the latest version of STS installed and I have 3 different version of index.php.html templates... one for the homepge and other two for 2 different categories. Now, when I'm looking at a product and decide to change the currency from USD to GBP, or whichever one really, it takes me to index.php?manufacturers_id=&currency=GBP.

 

What would make sense is that it loads the current page and just add "&currency=GBP". What do you guys think is the problem?

 

Ed.

Link to comment
Share on other sites

Please disregard my previous message hehehe i always have to make the fool then I miraculously found the answer out of nowhere.

The currency dropdown was conflicting with the manufacturer dropdown i have. Both get react when you select any entry in the dropdown.

 

Now I have to figure out how to fix the other one.. :)

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