You are here:  » $Titles...

Support Forum



$Titles...

Submitted by Harvey on Fri, 2006-09-08 12:59 in

Hey,

In my header.php, I'm using this to display the "keyword: sitename" sorta thing:

<?php
 
print $header["title"] - Jewelryresults.com</title></head>
?>

Thing is, on the index page (jewelryresults.com), it just says "- Jewelryresults.com", obviously because there's no keyword set.

Anyone know how I can say "If there's no keyword set, display an alternate title"?

BTW, I can't just hardcode a title on the index page 'cos it's already been set..

Cheers

Submitted by support on Fri, 2006-09-08 15:17

Hi Harvey,

It should be straight forward - but can you post the full snippet of code that you are using again as it doesn't seem to have come out correctly in your post.

$header["title"] contains the title tag constructed by the script for the search and product pages; but a default title is used if it is not set.

What variable are you using to construct your "Keyword - Jeweleryresults.com" - as I presume $header["title"] isn't what you want...

Cheers,
David.

Submitted by Harvey on Tue, 2006-09-12 10:57

Hi David,

My current title (in header.php, which is included on all pages) is:

print $header["title"]- Jewelryresults.com

However, there are PHP open/close tags before and after the PHP bit; it's just the forum software parses it strangely!

One way would be to set the header title variable as "Welcome", but I'm a bit of a PHP noob!

Cheers.

Submitted by support on Tue, 2006-09-12 11:09

Hi Harvey,

In the Price Tapestry distribution, the title is set by the following line of code in html/header.php:

<title><?php print (isset($header["title"])?$header["title"]:$config_title); ?></title>

Have you actually made changes to that file?

The way it is setup, you can set the title of pages that do not have a title generated by the script in config.php, for example - if you wanted your welcome message, you wouldn't need to change any code, except for the following in config.php:

<?php
  $config_title 
"Welcome to Jewelryresults.com";
?>

Cheers,
David.

Submitted by discountdriven on Mon, 2008-05-05 14:34

Hi David,

I can't figure out how to have different titles, keywords and descriptions on each page. Aside from the product pages, I have some different php pages that I created and I would like these to have different titles and meta tags.

Submitted by support on Tue, 2008-05-06 07:53

Hi Stacy,

If your additional PHP pages are using the standard Price Tapestry header; then you can set the title and meta keywords / description tags using the following block of code:

  $header["title"] = "Your title tag content here...";
  $header["meta"]["keywords"] = "Your, Keywords, Here";
  $header["meta"]["description"] = "Your description here...";

The above must come before the following line:

  require("html/header.php");

Hope this helps!

Cheers,
David.