Page 1 of 1

Want to write Product Name on top of page

Posted: Wed Dec 17, 2008 12:43 pm
by Mike718NY
I want to write the Product Name in the StandardHeader.htm when
a Product Page is displayed. For all other pages, I want default text.

I tried this. I does display the Product Name for the Product Pages,
but it is displaying the string "$Product.Name" for all other pages:

#if($Product.Name.Length==0)
"default text" << want displayed for every page except for Product Pages
#else
$Product.Name << displayed only on Product Pages
#end

This is what I want it to do:

#if < for any page other than a Product Page >
"default text"
#else
$Product.Name
#end

Is there a way to do this? thanks

Re: Want to write Product Name on top of page

Posted: Wed Dec 17, 2008 1:32 pm
by nickc

Code: Select all

#if ($Product)
$Product.Name
#else
No product here.
#end

Re: Want to write Product Name on top of page

Posted: Wed Dec 17, 2008 1:57 pm
by Mike718NY
that worked Nick, thanks!

I'm doing this to have the product name at the very top of the page
for SEO reasons. It is first thing that displays after the <body> tag,
except for all those "<script src="......" tags, which I don't think
the spiders read.