Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

STS and dynamic headers


compuskill

Recommended Posts

Hi there,

 

I have STS installed and I want to use dynamic headers, i. e. the meta description and the meta keywords are supposed to be the categories and/or the products names. If I change that in the sts_template.html, instead of executing the php code in the tags, it just shows the commands:

 

<html>
<head>
<meta name="keywords" content="<?php echo $seo_product_name;?>">

 

When I try to insert the code in the sts_display_output.php , all my shop gets messed up, and it doesn't work either. Can anyone post me the correct code? The meta tags are supposed to be like this:

 

<title><?php echo $page_title; ?></title><meta name="keywords" content="<?php echo $page_title; ?><?php if ($seo_product_model){echo ', ';} ?>, <?php echo $seo_manufacturer_name; ?>"><meta name="description" content="<?php echo $seo_product_name . ', ' . $seo_manufacturer_name . ' , ' . strip_tags(TITLE, ""); ?>">

 

Without STS it works fine. But where do I have to enter that code exactly and how in the sts_display_output.php?

 

/////////////////////////////////////////////
////// Display Template HTML
/////////////////////////////////////////////

 // Sort array by string length, so that longer strings are replaced first
 uksort($template, "sortbykeylength");

 // Manually replace the <!--$headcontent--> if present
   $template_html = str_replace('<!--$headcontent-->', $template['headcontent'], $template_html);

 // Automatically replace all the other template variables
 foreach ($template as $key=>$value) {
   $template_html = str_replace('$' . $key, $value, $template_html);
 }

 if ($display_template_output == 1) {
   echo $template_html;
 }

 

Thx for your help....

Link to comment
Share on other sites

Have you looked into the Header Tag Controller (HTC) contribution??

 

I've just installed it and from what I can gather so far, it'll do exactly what your trying to do. AND you can change the tags from within the Admin panel.

 

Cheers.

Link to comment
Share on other sites

Have you looked into the Header Tag Controller (HTC) contribution??

 

I've just installed it and from what I can gather so far, it'll do exactly what your trying to do. AND you can change the tags from within the Admin panel.

 

Cheers.

 

Uhm, I don't know what contrib I have used for the header tags. I think I have a different one as I don't have a menue for that in the admin panel. So do you know how I can solve my problem?

 

Cya,

Compuskill

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.
Note: Your post will require moderator approval before it will be visible.

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