when I try to set the robots tags by xml or programatically in _preparelayout, it doesn't work. Instead they are always NOINDEX, FOLLOW. This also happens for categorysearch but I cannot find the code where the robots-tags are changed and actually set.
in local.xml I tried:
<tag_product_list translate="label">
<label>Tagged Products List</label>
<!-- Mage_Tag -->
<reference name="head">
<action method="setRobots"><value>INDEX,FOLLOW</value></action>
</reference>
</tag_product_list>
in Tag/Block/Product/result.php I tried
$head = $this->getLayout()->getBlock('head');
$head->setDescription($description);
$head->setRobots('index, nofollow');
Setting the description works fine. But the robot-tags are always set to NOINDEX,FOLLOW.
Can anyone tell me, where the robot-tags for tag pages or catalogsearch pages are set?
Thanks
Best Answer
Create your custom module to do so.
app/code/local/Custom/MetaChange/etc/config.xml
app/code/local/Custom/MetaChange/Model/Observer.php
Please create your module activation file.
What I think that you are trying to change robots tags after xml has been generated, you need to do it before xml is generated.
Hoping this will help you.