Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] Simple Template System (sts)


DiamondSea

Recommended Posts

You can do it in php also with STS v2.01, but you have to put the text in a new sts placeholder, and put the placeholder on the template. This can be done in sts_user_code.php .

 

- Rigadin2

Link to comment
Share on other sites

My STS_OUTPUT seems to be called twice, certainly the $headcontent does anyway. I'm not too sure when the problem started but I noticed it when I added header tags. Upon checking the page source I noticed that all the meta tags are shown twice and so it some tracking codes (also in the header).

 

Has anyone experienced this before and does anyone know how to fix it?

 

Thank You

Link to comment
Share on other sites

Hi I've been using sts_user_code.php, to try to set up a placeholder which only has to pull some text from the database and am having a bit of trouble (predictably).

 

I thought i could just do something like this:

 

$sts_block_name = 'customermessage';

require(STS_START_CAPTURE);

<?php echo nl2br(CUSTOMER_MESSAGE); ?>

require(STS_STOP_CAPTURE);

 

I've already created the database key but all I get is parse errors.

 

Can someone help me out and suggest how to do this cos as you can see I'm a complete div with PHP

 

Cheers

 

Ian

Link to comment
Share on other sites

My STS_OUTPUT seems to be called twice, certainly the $headcontent does anyway. I'm not too sure when the problem started but I noticed it when I added header tags. Upon checking the page source I noticed that all the meta tags are shown twice and so it some tracking codes (also in the header).

 

Has anyone experienced this before and does anyone know how to fix it?

 

Thank You

When you installed HTC, did you add the code in catalog side from the HTC contribution? If so, then this is what is causing the double meta tags. When using STS with HTC, you do not install the catalog side of the HTC contribution.

 

To configure STS to work with HTC, you need to add some files to include in the STS modules in the admin panel.

 

For example:

For the default module, you have a parameter named “Files for normal template”. By default it contains only “sts_user_code.php”. If you modify this parameter to “sts_user_code.php;headertags.php”, you will have Header Tags Controller working for all of the pages using the default template. Do the same for the other modules below.

For the index module, the parameter is called “Files for index.php template”.

For “product_info module”, there are 2 parameters:

“Files for normal template”

“Files for content template”.

 

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

Further to my previous post;

 

Ive been playing around a bit looking at the format of the rest of sts_user_code.php and its all one section of PHP so obviously by previous code was causing an error. I though I should be able to do something like this:

 

 

$sts_block_name = 'customermessage';

require(STS_START_CAPTURE);

echo (CUSTOMER_MESSAGE);

require(STS_STOP_CAPTURE);

 

But it completely ignores the tag on the template (and just prints it on the screen)

 

I can pull this text correctly from the database elsewhere on the site but just cannot get it working through sts. Any suggestions would be much appreciated.

 

Cheers

 

Ian

Link to comment
Share on other sites

Hi, I need your help....

I get an eror massage on my index page , this is the only thing displayed:

 

Languages  


Error!

Unable to determine the page link!

As far as i know i did not change a thing and suddenly this eror appers...

(It looks like it is trying to load the language box although i'm not using it)

 

PLEASE PLEASE HELP ME...

Link to comment
Share on other sites

Hi, I need your help....

I get an eror massage on my index page , this is the only thing displayed:

 

Languages 


Error!

Unable to determine the page link!

As far as i know i did not change a thing and suddenly this eror appers...

(It looks like it is trying to load the language box although i'm not using it)

 

PLEASE PLEASE HELP ME...

go to your admin panel and under configuration and my store change

 

Use Search-Engine Safe URLs (still in development) to false

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

First, thanks for this contribution. I wouldn't want to use oscommerce at all if I couldn't get this kind of functionality.

 

And now my problem: I can't get templates for specific product_info pages to work at all. All I'm seeing is the default index.html template.

 

I enabled the product info module, set "use template for product info page" to true, created a "sts_templates/test/content/" folder, and put my template file in it. Looking at my store with templates disabled entirely, the link to the specific product I'm testing appears to be "/catalog/product_info.php?cPath=24&products_id=30." So, I named my template product_info.php_30.html. With templates enabled, it doesn't find anything when I follow the above link from the front page, it just gives me the index template.

 

This is a new site and I've only created one product total, so I thought it was odd that it has ID #30. Just for fun I tried naming my template product_info.php_1.html, but no dice there either.

 

Is there something flamingly obvious that I'm missing? I need to get this figured out before I put a coffee mug through my monitor. :angry:

 

Any help would be greatly appreciated!

Link to comment
Share on other sites

First, thanks for this contribution. I wouldn't want to use oscommerce at all if I couldn't get this kind of functionality.

 

And now my problem: I can't get templates for specific product_info pages to work at all. All I'm seeing is the default index.html template.

 

I enabled the product info module, set "use template for product info page" to true, created a "sts_templates/test/content/" folder, and put my template file in it. Looking at my store with templates disabled entirely, the link to the specific product I'm testing appears to be "/catalog/product_info.php?cPath=24&products_id=30." So, I named my template product_info.php_30.html. With templates enabled, it doesn't find anything when I follow the above link from the front page, it just gives me the index template.

 

This is a new site and I've only created one product total, so I thought it was odd that it has ID #30. Just for fun I tried naming my template product_info.php_1.html, but no dice there either.

 

Is there something flamingly obvious that I'm missing? I need to get this figured out before I put a coffee mug through my monitor. :angry:

 

Any help would be greatly appreciated!

Patrick,

Are you using the $startform$ and $endform$ in your product template?

I would suggest that you use the included product template "full/content/product_info.php_26.html" and rename it to "product_info.php_30.html".

 

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

Patrick,

Are you using the $startform$ and $endform$ in your product template?

I would suggest that you use the included product template "full/content/product_info.php_26.html" and rename it to "product_info.php_30.html".

 

Hope this has helped you out,

 

 

My template does include $startform$ and $endform$. It's just a slightly edited version of the sample form, with all the php tags labeled so I can tell what the output is. I tried using the original sample renamed to product_info.php_30.html in both the test and full folders.

 

Here's a link to the product template file I'm trying to use:

http://bestcarmagnet.com/osc/catalog/inclu...nfo.php_30.html

 

If I go straight to that address, I can view the file just fine, though of course none of the php is processed. But if I go to the site's index page and try to use the test link there, I get nothing but another index template. The site index is at:

http://bestcarmagnet.com/osc/catalog/

 

I presently have it set to use the test template, so it seems like this ought to be working. Am I doing something wrong in the linking perhaps?

Link to comment
Share on other sites

I just discovered another weird thing... If I place my product info page, product_info.php_30.html, not inside the "content" directory but right in the "test" directory, the link does work and displays the right html, but none of the php is processed. So, it seems like STS is not actually looking inside the "content" directory for product pages, and like there is some problem processing the PHP if it finds the file but in an unexpected place. Argh....

Link to comment
Share on other sites

I have it sort-of working now, but every time I solve one problem it creates another. Apparently it will only pull my product info template if I use the $content tag in both my index.php.html and my product_info.php_30.html files. This creates another problem though, which is that all of the stuff that's on the index page that I do not want on the product page will be shown there. Basically it renders my index page, and then below that the product info page.

 

Is it correct that I absolutely must use the $content tag? If not, how come it doesn't work at all when I leave it out (see above problems)?

Link to comment
Share on other sites

Hi Patrick,

 

Your template for product 30 is nearly working. I explain:

There are 2 types of templates: main templates that display header/columns/footer/$content and content templates that replace the $content of the main template.

Content templates are placed in the content folder, so your first trial was correct: product_info.php_30.html in content folder.

 

Now, when you look at the product_info.php page for product ID 30, it is using index.php.html as main template and content/product_info.php_30.html as content template (you can find more details about how the templates are selected in the manual). As index.php.html has $content completely down on the page, your product parameters (description, name, price, ...) are also down the page.

 

If you wonder why you have too many $ on the page, it is because you wrote the placeholders like this: $description$ but by default templates need only $description. You should place the following code at the beginning of your content template:

<?php DEFINE ('STS_CONTENT_END_CHAR', '$'); ?>

Or remove all the dollars at end of placeholders (it is however better to place the php code, to avoid extra loops when replacing placeholders by their value).

 

I hope it helps,

 

Chris "Rigadin2"

Link to comment
Share on other sites

We downloaded the 4.5 version of STS followed the instructions, copied all the files to the oscommerce folders, we noticed the include folder is outside of the catalog folder. Tried in both places. When we go to admin panel to modules it is not showing up on the left had side?????? Therefore we can not install the sts, can you help us please!

Link to comment
Share on other sites

We downloaded the 4.5 version of STS followed the instructions, copied all the files to the oscommerce folders, we noticed the include folder is outside of the catalog folder. Tried in both places. When we go to admin panel to modules it is not showing up on the left had side?????? Therefore we can not install the sts, can you help us please!
Phyllis, There are two folder inside the "catalog" of the contribution: admin and includes. You need to install both of these folders. The admin folder is going to add the STS module in your admin control panel (where it is now missing).

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

How would I create a template for the categories page? it is using the index template because of the url: index.php?cPath=31&osCsid=f1dae4e46c3a01546dbab3c0ce41728f

 

Thanks in advance

Link to comment
Share on other sites

I have just moved my store to a new server and moved all the files and everything and I'm getting this error

 

Warning: require(STS_START_CAPTURE) [function.require]: failed to open stream: No such file or directory in /home/xxx/public_html/shop/includes/application_top.php on line 556

Warning: require(STS_START_CAPTURE) [function.require]: failed to open stream: No such file or directory in /home/xxx/public_html/shop/includes/application_top.php on line 556

Fatal error: require() [function.require]: Failed opening required 'STS_START_CAPTURE' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxx/public_html/shop/includes/application_top.php on line 556

 

What does this mean?

Link to comment
Share on other sites

How would I create a template for the categories page? it is using the index template because of the url: index.php?cPath=31&osCsid=f1dae4e46c3a01546dbab3c0ce41728f

 

Thanks in advance

If you wanted to create a template for Category 31, you would create a template and save it as “index.php_31.html”.

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 got a strange problem with STS. It works fine untill I set the folder test to full..

When I click on an object or catagorie in my categorie box it always goes back to my index page and NOT the product..

I turned off STS and it al works again.. What's the problem?

Link to comment
Share on other sites

i really like how easy STS makes it easy for me to add or remove things from my pages, however i was wondering if there is a quick way to center everything and give it a fixed width and not 100% so it can line up better with my CMS front end.

 

i tried just using an HTML page that generates my front page and add the $catalog, etc where i wanted things to show up, but it never worked, so im willing to stay fairly default and just make it look similar.

 

any help is greatly appreciated.

 

Thanks!

Link to comment
Share on other sites

I'm setting up STS 4.4 in a multilanguage template...

 

I only got some problems with setting up my own links / text...

 

I'm using this code

 

$sts->template['defects'] = EXTRA_DEFECTS ;

 

 

But some $variables in the template aren't showing up. I there some kind of maximum set in STS about how many custom codes can be set? And how/where can I change that?

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