Hallo,
how i can add a suffix to the <title> tag on product pages. so that the text appears only withingthe <title> tags in the <head> of product pages but not in the actual product titles themselves.
Thank You
how i can add a suffix to the <title> tag on product pages. so that the text appears only withingthe <title> tags in the <head> of product pages but not in the actual product titles themselves.
Thank You
TECHNODISCOUNT24 - BUY WITH ALERTPAY AND MONEYBOOKERS
Free Shipping Worldwide and Cheapest Prices
Buy Gadgets on the best Alertpay Shop
I would like to know where/how to add text to the browser title, but not the product itself too. the same to each page is fine..
open: catalog/view/theme/default/template/common/header.tpl
find:
replace with:
OR If you just want to append the site name:
replace with:
find:
Code: Select all
<title><?php echo $title; ?></title>
Code: Select all
<title><?php echo $title . (isset($this->request->get['route'])&&$this->request->get['route']!='product/product'?' - WHATEVER YOU WANT'); ?></title>
replace with:
Code: Select all
<title><?php echo $title . (isset($this->request->get['route'])&&$this->request->get['route']!='common/home'&&$this->request->get['route']!='product/product'?' - ' . $this->config->get('config_name'):''); ?></title>
I want to make it different for every product. So please can you tell me where to change it? Thank Youuksitebuilder wrote:Will the suffix be the same for all product pages or different for each product ?
TECHNODISCOUNT24 - BUY WITH ALERTPAY AND MONEYBOOKERS
Free Shipping Worldwide and Cheapest Prices
Buy Gadgets on the best Alertpay Shop
Do you use the 'Location' field in your edit product screen for anything ?
If not you could put the unique text in there.
Then we just need to append it to the title on the product page.
If not you could put the unique text in there.
Then we just need to append it to the title on the product page.
When I replace the code below, the homepage's browser title shows "Notice: Undefined index: route in..."
and nothing changes on the product pages.
And nothing happens (no errors either) when I change it to the one below.
and nothing changes on the product pages.
Code: Select all
<title><?php echo $title; if($this->request->get['route']!='product/product'){ echo ' - WHATEVER YOU WANT'; } ?></title>
Code: Select all
<title><?php echo $title . (isset($this->request->get['route'])&&$this->request->get['route']!='common/home'&&$this->request->get['route']!='product/product'?' - ' . $this->config->get('config_name'):''); ?></title>
OK, I changed one code block, but forgot the other, apologies, I have amended my code above.
You asked, for the title to be appended if not on the product page, or did I misunderstand your question ?
You asked, for the title to be appended if not on the product page, or did I misunderstand your question ?
Yes, I wanted to add some extra text to the title (the one on the web browser), but not to the product title on the webpage. I wanted to use the first code you gave. Tried it again and the site doesn't load. It's a blank page this time.
ahh ok, not sure why you are getting a blank page.
So if I have this correct, you want to append a phrase to the META title on all pages including the product page (the browser page title). I misunderstood before and thought you meant all pages apart from the product pages.
If so, then, try this code. I have actually just done the same for my sites by appending the site name to the title, but you can use any phrase.
find:
replace with:
So if I have this correct, you want to append a phrase to the META title on all pages including the product page (the browser page title). I misunderstood before and thought you meant all pages apart from the product pages.
If so, then, try this code. I have actually just done the same for my sites by appending the site name to the title, but you can use any phrase.
find:
Code: Select all
<title><?php echo $title; ?></title>
Code: Select all
<title><?php echo $title . ' - WHATEVER YOU WANT'; ?></title>
aha yes, i want to append a phrase to the meta title of the product pages. Thanks! It works. How do I exclude the homepage from getting appended?
Code: Select all
<title><?php echo $title . (isset($this->request->get['route'])&&$this->request->get['route']!='common/home'?' - WHATEVER YOU WANT':''); ?></title>
do you get a blank page without the code change above ?
are there any errors in your admin error log ?
are there any errors in your admin error log ?
Just tried the code again and it works. My bad, I must have left out the while editing my keyword. Thank you for ur help!
Code: Select all
':''
I am not using the location field and i leave it always blank.uksitebuilder wrote:Do you use the 'Location' field in your edit product screen for anything ?
If not you could put the unique text in there.
Then we just need to append it to the title on the product page.
TECHNODISCOUNT24 - BUY WITH ALERTPAY AND MONEYBOOKERS
Free Shipping Worldwide and Cheapest Prices
Buy Gadgets on the best Alertpay Shop
Who is online
Users browsing this forum: No registered users and 121 guests