Author Topic: Index Follow Category  (Read 224 times)

fabioweb

  • Jr. Member
  • **
  • Posts: 112
Index Follow Category
« on: October 17, 2017, 23:19:50 pm »
Hello,
is it possible to setup this with noindex,follow
and this url with "index,follow" ?

In short these are the same product page but i need different robots managment 

Thank you

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2410
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Index Follow Category
« Reply #1 on: October 24, 2017, 00:58:01 am »
If you need to do this, you have to use condition.
sample code using categories (to modify for your needs) :
Code: [Select]
$document = JFactory::getDocument();
If ($cat_id == "XXX") $document->setMetaData('robots','noindex,follow');
else $document->setMetaData('robots','index,follow');
But of course in this case all product in same category have same meta robots, so you need perhaps use a product id and cat id filter.

fabioweb

  • Jr. Member
  • **
  • Posts: 112
Index Follow Category
« Reply #2 on: October 24, 2017, 12:15:37 pm »
Thank you for your help.. Where i need to insert the code?

Regards

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2410
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Index Follow Category
« Reply #3 on: October 24, 2017, 12:54:48 pm »
In your product page JOOMLAROOT/templates/YOURTEMPLATE/html/virtuemart/productdetails/default.php
But is i said, it's not complete and need some more work.
It's possible to write a system plugin too, to check category+product, bit is longer to do.