Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Odd meta title behaviour
 
iblastoff
Sr. Member
 
Total Posts:  252
Joined:  2007-08-31
 

relevance:(ver. 0.8.16100)

When I’m viewing a specific product, I can see the meta description and meta keywords showing up in the source, but the Meta Title never seems to take effect. The title always seems to just take on the regular “Title” attribute instead of the specified Meta Title (shouldn’t it be renamed to “Page Title” anyway like Categories?) for that product. And yes I am editing at the “english” store view.

So I took a look at the source and am viewing this file

app/code/core/Mage/Catalog/Block/Product/View.php

after playing around, I noticed if I get rid of this line at line 60

$this->getLayout()->createBlock('catalog/breadcrumbs');

then all of a sudden the actual meta title shows up! of course this means the breadcrumb also disappears. So I follow that trail and open up

app/code/core/Mage/Catalog/Block/Breadcrumbs.php

I notice at around line 43 the title gets set again so it seems to lose the meta title there. Is that how you guys intend it to be? Because currently the meta title for a product never actually shows up unless that code is altered.

my solution was:

move the

$this->getLayout()->createBlock('catalog/breadcrumbs');
code at line 60 in

app/code/core/Mage/Catalog/Block/Product/View.php

and place it right below this line
if ($headBlock $this->getLayout()->getBlock('head')) {
at around line 40.

now the breadcrumbs are still getting set and the meta title for the product also works.

 
Magento Community Magento Community
Magento Community
Magento Community
 
iblastoff
Sr. Member
 
Total Posts:  252
Joined:  2007-08-31
 

bump to show my solution in the initial post for those that want the meta title for products to work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lorenzo01
Sr. Member
 
Avatar
Total Posts:  221
Joined:  2007-09-06
France
 

hello iblastoff,
do you have the solution for the meta description and keywords of categories ?
thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
iblastoff
Sr. Member
 
Total Posts:  252
Joined:  2007-08-31
 

lorenzo1: sure

here it is : http://www.magentocommerce.com/boards/viewthread/2676/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top