Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

Robert,

It appears you are trying to paste your code here in the forums from a WYSIWYG type of editor or from a non-plain text editor.

Try this:

Paste your code into a plain text editor such as Windows NotePad. Then copy that code from NotePad into this forum.

I'm trying to rule out that you are actually calling in the JavaScript correctly. With the

&alt;
at the beginning of that line, you will not get your JavaScript called.

 

As for the STS debug: Post the link to the page that is giving you problems and I will run the debug myself. I'm guessing that you did not do it properly and that is why you are not getting anywhere with it. However, if the debug feature does not work for you, it will tell me that you do not have STS installed correctly. Either way it will tell us something.

 

Note: Doe your shop work as it should without any errors if STS is turned off in the admin? I would like to rule out whether this is a STS issue or not.

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

Robert,

It appears you are trying to paste your code here in the forums from a WYSIWYG type of editor or from a non-plain text editor.

Try this:

Paste your code into a plain text editor such as Windows NotePad. Then copy that code from NotePad into this forum.

I'm trying to rule out that you are actually calling in the JavaScript correctly. With the at the beginning of that line, you will not get your JavaScript called.

I open the page, I rightclick the page, >view sourcecode, page opens in Windows wordpad, I copy and paste the text directly into the codebox of this forum's editor. It ends up screwy all the time

 

As for the STS debug: Post the link to the page that is giving you problems and I will run the debug myself. I'm guessing that you did not do it properly and that is why you are not getting anywhere with it. However, if the debug feature does not work for you, it will tell me that you do not have STS installed correctly. Either way it will tell us something.

 

Note: Does your shop work as it should without any errors if STS is turned off in the admin? I would like to rule out whether this is a STS issue or not.

 

When I turn off STS in the admin section, the page opend faultless

 

The page is at

http://www.coloursite.nl/oerbronwerk/catal...8184d4ebcbde45c

Link to comment
Share on other sites

Did you make the necessary edits to the catalog/includes/header.php file?

 

 

<?php
/*
 $Id: header.php,v 1.42 2003/06/10 18:20:38 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
*/

 // START STS 4.4
 $sts->restart_capture ('applicationtop2header'); // Capture header from the actual script, needed to take out javascript
 // END STS 4.4

When I ran the debug, I noticed that you were not picking up the JavaScript in your header as well as not including the 'applicationtop2header' information at all.

Please post what you have in the first 10 or so lines in your STS Templates. What I am looking for here is to make sure you are including the required code in the <head> of your HTML template pages.

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 should run the STS debug command.
  • For one, it is very easy to do
  • And for another it will give you valuable troubleshooting information regarding what is actually going on behind the scene.

What Rigadin is sugggesting is that you first run the debug command and then check at the very bottom of your page the information that the debug routine will display. In this information, find the data listed for the 'headcontent' and then post it here for the good folks in this forum to try to troubleshoot for you.

 

**TIP**

To see the debug output of whateverpage.php, write the URL www.yourshop.com/whateverpage.php?sts_debug=debug in your browser address window.

 

<<just out of curiosity,>>

On whatever page I run it, I always get the

1062 - Duplicate entry '<bladibla> ' for key 1

message

and everything is fine, now.

What does the 1062 msg. mean?

 

Thanks for helping me out.

It really made a world of difference for me.

Link to comment
Share on other sites

<<just out of curiosity,>>

On whatever page I run it, I always get the

1062 - Duplicate entry '<bladibla> ' for key 1

message

and everything is fine, now.

What does the 1062 msg. mean?

 

Thanks for helping me out.

It really made a world of difference for me.

In order to run the Debug, keep in mind you need to first get rid of the SID (session ID) in the URL. Add this at the end of the URL:

sts_debug=debug

 

It should look something like this:

http://www.yourstore.com/catalog/index.php?sts_debug=debug

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

 

A dynamic horizontal dropdown menu is central to my layout. I have been unsuccessful getting the horizontal dropdown to work with sts v4.4

 

By chance, does it work with any other sts v4.x versions?

 

Is there another dynamic menu contribution that will work with sts?

 

-dano

Link to comment
Share on other sites

ok I have been all over these pages the last few days cutting and pasting code and my head is swimming. I am still getting the ie error on the pop up image when using sts. can anyone please send me the exact code - where to put it on what file to fix this problem I ran the debug on the url and there were no results. please help thank you in advance.

 

store is on

www.foreversierrarose.com

Edited by thetechguy
Link to comment
Share on other sites

ok I have been all over these pages the last few days cutting and pasting code and my head is swimming. I am still getting the ie error on the pop up image when using sts. can anyone please send me the exact code - where to put it on what file to fix this problem I ran the debug on the url and there were no results. please help thank you in advance.

 

store is on <a href="http://www.foreversierrarose.com" target="_blank">

www.foreversierrarose.com

</a>

 

also I cant seem to figure out how to change the font colors on links

Link to comment
Share on other sites

Okay I figured out my pop up problem I just need to figure out the font color now for links thank you

You should be able to change your font colors in your stylesheet.css file located in your root or catalog folder. Just look for the A class like this. Just change to the color you want to.

 

/*This is the Default Hyperlink Style with brown text and underlines*/
A {
color: #731F17;
text-decoration: underline;
font-weight: bolder;
}

/*This is the Default ACTIVE Hyperlink Style when a mouse is hovering over it, with dusty blue text and no underline*/

A:hover {
 color: #6666CC;
 text-decoration: none;
 font-weight:normal;
}

 

If for some reason this does not change your link color then you have it set in another place as well (which is not needed).

 

Good luck,

 

Gary

Link to comment
Share on other sites

how can i add pages to my OSC that still use the STS place holders so i can make a custom page that has $checkoutbox or $"whatever" because if i just put that on a page and upload it it will say the holder not display the box... i hope this makes sense.. Actualy better yet how do i make it work in my includes/languages/english/index.php

Edited by sacaccess
Link to comment
Share on other sites

how can i add pages to my OSC that still use the STS place holders so i can make a custom page that has $checkoutbox or $"whatever" because if i just put that on a page and upload it it will say the holder not display the box... i hope this makes sense.. Actualy better yet how do i make it work in my includes/languages/english/index.php
Demetre,

Check out the contribution for adding new pages in the STSv4 Power Pack site (link in my signature below).

Also, keep in mind that in order for the tags to work, you must have the required code in the <head> of your page. See the provided blank sts template in the test folder that came with the STS contribution for an example.

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 should be able to change your font colors in your stylesheet.css file located in your root or catalog folder. Just look for the A class like this. Just change to the color you want to.

 

/*This is the Default Hyperlink Style with brown text and underlines*/
A {
color: #731F17;
text-decoration: underline;
font-weight: bolder;
}

/*This is the Default ACTIVE Hyperlink Style when a mouse is hovering over it, with dusty blue text and no underline*/

A:hover {
 color: #6666CC;
 text-decoration: none;
 font-weight:normal;
}

If for some reason this does not change your link color then you have it set in another place as well (which is not needed).

 

Good luck,

 

Gary

 

first of all my stylesheet does not have this code and next when I change my stylesheet font sizes and color nothing happens - however when I uninstall sts4 I notice that the stylesheet did change the fonts on the lang\eng\index.php - what am I missing? do I also need to make sure that the correct code is in the head of my sts4 template to allow the style sheet to work?

 

Thanks for your help

Jon

Link to comment
Share on other sites

first of all my stylesheet does not have this code and next when I change my stylesheet font sizes and color nothing happens - however when I uninstall sts4 I notice that the stylesheet did change the fonts on the lang\eng\index.php - what am I missing? do I also need to make sure that the correct code is in the head of my sts4 template to allow the style sheet to work?

 

Thanks for your help

Jon

 

I can not be sure without looking at your files but more likely than not it sounds like the font is being set in your STS template. Which is OK but in my opinion it is better to make it so that the style sheet does the changes. Can you paste the code from your catalog/includes/sts-templates/YOUR_TEMPLATE/index.php.html (Where YOUR_TEMPLATE is the name of your template you are using, could be full or basic if you have not created one. ) file for us to have a look at.

 

Gary

Link to comment
Share on other sites

Hi all,

 

I have installed the contribution, went to admin section and clicked install.

I then clicked edit and on the question "Do you want to use Simple Template System?", I chose True, and then UPDATE

 

However, my choice of enabling the STS system is not saved and it automatically returns to False, after everytime I click on the update button.

 

Any help will be appreciated.

Thanks

Link to comment
Share on other sites

Hi all,

 

I have installed the contribution, went to admin section and clicked install.

I then clicked edit and on the question "Do you want to use Simple Template System?", I chose True, and then UPDATE

 

However, my choice of enabling the STS system is not saved and it automatically returns to False, after everytime I click on the update button.

 

Any help will be appreciated.

Thanks

I posted a response 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

Link to comment
Share on other sites

I am having issues creating a custom template for a specific page.

The instructions in the documentation are not that detailed.

Could you please give me a run down

 

My understanding is to create a file in the /modules/sts/ folder

and to add a file in the sts_templates/test folder

 

Reading further into the documentation is tells off creating a specific module type.

 

Is there a way to customize a specific page without creating a module?

 

 

Shane

Link to comment
Share on other sites

Dear bkellum,

 

Thanks for the tip! I solved this problem but now I have encountered another one!

 

I have copied a basic html template in the includes/sts_templates/test folder.

 

In the "Template Folder" option in admin, I have put "test" and on the "Default template file" Ive put index.html whici is actually the name of the file of the template.

 

Inside the "test" folder there also recides a folder named "images" that contains the images that the html file calls for.

 

When I open the page on the browser, the layout and text appears but not the images!

 

I get the message:

The requested URL /280307/oscommerce-2.2ms2-060817/catalog/images/l1.gif was not found on this server.

Apache/1.3.33 Server at 127.0.0.1 Port 80

 

although the images are actually on this path!!!

 

Am I missing something??

 

Thanks in advance for your help

Link to comment
Share on other sites

Problem solved. I have copied the images to the catalog/images folder and show up properly.

 

Can I use css for this new template? Will it be a new css file or should it be incorporated into the old one tha comes with oscommerce? I would guess a new one. HOwever, in which folder should I put it?

 

thnx!

Edited by fenizol
Link to comment
Share on other sites

I am having issues creating a custom template for a specific page.

The instructions in the documentation are not that detailed.

Could you please give me a run down

 

My understanding is to create a file in the /modules/sts/ folder

and to add a file in the sts_templates/test folder

 

Reading further into the documentation is tells off creating a specific module type.

 

Is there a way to customize a specific page without creating a module?

 

 

Shane

Shane, it is quite easier than all that you mentioned above...

 

Here is a quick run-down (just the beginning...so much more available)

 

1) sts_templates.html

 

This sets the general look and feel for your entire site.

This is the only required template if you only want to use ONE template for everything.

 

 

If you want to further customize your site, then you can also create:

 

2) index.php_0.html

This is the template to use for your home page.

NOTE:
You must have the Index Module enabled in the admin to use this feature as well as check off the Use Parent Templates in the admin.

 

3) index.php_???.html

 

These are the templates for specific categories, where ??? should be replaced by the cPath for the category.

NOTE:
You must have the Index Module enabled in the admin to use this feature as well as check off the Use Parent Templates in the admin.

HINT:
View your shop in a browser and click on a category. You should see what the cpath is in the Browser Address Bar window.

 

4) product_info.php.html

 

This is the generic product_info template. Use this if you want ONE template to be used for ALL of your products.

NOTE:
You must have the Product Info Module enabled in the admin.

 

5) product_info.php_???.html

 

This lets you set a product_info template by category. ??? should be replaced by the cPath.

NOTE:
You must have the Product Info Module enabled in the admin.

 

6) content/product_info.php_???.html

 

This lets you set a product_info template by product id. ??? should be replaced by the product id for the item.

NOTE:
You must have the Product Info Module enabled in the admin.

NOTE:
You must have this template located in the "content" folder of your template folder.

 

7) index.php_mfr.html

 

This lets you set a generic template for the manufacturer pages.

 

8) index.php_mfr_???.html

 

 

 

This lets you set a specific template for the manufacturer page. ??? should be replaced with the manufacturerID of the manufacturer page.

 

 

OK. Please realize that the above was quick and probably dirty. :lol: So I appologize for any errors. The gang can correct me if I made any mistakes on the above. :-

This should get you started in the right direction though.

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

Problem solved. I have copied the images to the catalog/images folder and show up properly.

 

Can I use css for this new template? Will it be a new css file or should it be incorporated into the old one tha comes with oscommerce? I would guess a new one. HOwever, in which folder should I put it?

 

thnx!

I would stick with the stylesheet.css file in your catalog folder (stock osC file) and just modify it to meet your needs. Be sure to include the required code in the head of each of your templates in order to link to the external stylesheet. (see the blank sts template provided in the test folder)

 

Your solution to your image problem works but the real issue was a path problem in your image links. You can place your images in any folder that you want, you just have to be sure the links are relative to that folder and your catalog folder. Nothing out of the ordinary with that, just simple relative HTML links.

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 am in need of a little guidance. I have attained a pretty good grasp of the STS Template system (I think :blink: ) but I believe that what I am wanting to do may be a little out of the ordinary everyday STS users need. I want to create a custom pop up that I can control with an STS Template that I create for it. I have already managed to create the code required to show what I want to show in the Pop up and I have created a tag to call the link needed for someone to click on it to call the pop up. I am stuck at this point however.

 

I have this file located at catalog/includes/boxes/veiw_more_info.php

 

<?php
/*
 $Id: view_more_info.php,v 1.11 2007/03/20 16:00:00 $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2007 osCommerce

 Released under the GNU General Public License

 */
//Start Modification for link to show manufacturers info in a pop-up window.
			if (isset($HTTP_GET_VARS['products_id'])) {
			$manufacturer_query = tep_db_query("select m.manufacturers_id, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
			if (tep_db_num_rows($manufacturer_query)) {
			  $manufacturer = tep_db_fetch_array($manufacturer_query);

		$manufacturer_info_string = '<center>';
			  if (tep_not_null($manufacturer['manufacturers_id'])) $manufacturer_info_string .= '<a href="java script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_MANUFACTURER_INFO, 'products_id=' . $products_id) . '\')">' . TEXT_MANUFACTURER_INFO_SHIPPING_LINK . '</a> </td> </tr>';
		'';
			  $info_box_contents = array();
			  $info_box_contents[] = array('text' => $manufacturer_info_string);

			  new infoBox($info_box_contents);
			  '</center>';
			}
		  }
//End Modification for link to show manufacturers info in a pop-up window.
?>

 

I added this code to the file catalog/includes/modules/sts_inc/product_info.php . It is the only way I could get it to be able to call a tag from with in the catalog/includes/sts_templates/gourmet_soiree/content/product_info.php.html template file.

 

// Start more info box that shows under the product that opens a pop up with the manufacturers info in it.
 $sts->start_capture();
 include(DIR_WS_BOXES . 'view_more_info.php');
 $sts->stop_capture('viewmoreinfo', 'box'); // Get manufacturer info box (empty if no product selected)
  $template_pinfo['viewmoreinfo']= $sts->template['viewmoreinfo']; // Put it in the product info
// End more info box that shows under the product that opens a pop up with the manufacturers info in it.

 

Now all of this works great and I am somewhat happy with the way it shows up. Problem comes when I want to format the way the pop up looks. The tables are not resizing correctly and neither is the window for that matter but I can live with the window not resizing.

 

What I would like to do is create the same structure that the popup_image.php has but I just can't seem to wrap my head around everything that needs to be done. By following the pop_up I can see that I am going to have to create three files. One in the STS folder, one in the STS_Inc folder and the template file in my template folder. Can anyone give me any direction on how I would go about that from the code that I have pasted above? I am gathering the information from different tables and rows when displaying the view_more_info pop up or I would just coppy the pop_up files and rename them. Sorry for the long post!

 

You can see how this works now if you want if it will help. Just have a look at any product in our store and click on the link below the product description that says "click here for more information on this manufacturer blah blah blah ....".

This site is live. here is a good example http://gourmetsoiree.com/chocolate-assortment-p-170.html

 

Even if you don't have the whole answer I would be thrilled to have a part. Sooner or later it will come together.

 

 

Thanks,

 

Gary

Link to comment
Share on other sites

Hi, I've updated 4.4 to 4.5

Now i get this strange message that 'infobox_header.php.html' is missing.

 

I have created a infobox_header.php.html with this content:

<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#00FF00">

<tr>

</tr>

</table>

 

Now things are back to normal... But why is STS asking for a file that is not documented anywhere???

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