- Posts: 465
- Thank you received: 19
No index, no follow
- Reincidente
-
Topic Author
- Offline
Less
More
4 years 8 months ago #339368
by Reincidente
No index, no follow was created by Reincidente
Hello.
How can I put in "no index", "no follow" the url of a Hikashop product?
How can I put in "no index", "no follow" the url of a Hikashop product?
Please Log in or Create an account to join the conversation.
4 years 7 months ago #339374
by nicolas
Replied by nicolas on topic No index, no follow
Hi,
It's possible. You can edit the file product / show.php via the menu Display>Views
There, you can add such code at the beginning:
It's possible. You can edit the file product / show.php via the menu Display>Views
There, you can add such code at the beginning:
Code:
<?php
$doc = JFactory::getDocument();
$doc->setMetadata('robots', 'noindex, nofollow');
?>
Please Log in or Create an account to join the conversation.
- Reincidente
-
Topic Author
- Offline
Less
More
- Posts: 465
- Thank you received: 19
4 years 7 months ago #339387
by Reincidente
Replied by Reincidente on topic No index, no follow
Hi.
But that code would affect all products.
I want to be able to use it only on certain products that I don't want to be indexed.
Can this be done?
But that code would affect all products.
I want to be able to use it only on certain products that I don't want to be indexed.
Can this be done?
Please Log in or Create an account to join the conversation.
4 years 7 months ago #339389
by nicolas
Replied by nicolas on topic No index, no follow
Hi,
Sure.
Create a custom product field with two values 'yes' and 'no', and then change that code to:
where xxx is the column name of that custom product field and the noindex nofollow will be added to the product only if "yes" is selected in the custom field.
Sure.
Create a custom product field with two values 'yes' and 'no', and then change that code to:
Code:
<?php
if($this->element->xxx == 'yes') {
$doc = JFactory::getDocument();
$doc->setMetadata('robots', 'noindex, nofollow');
}
?>
Please Log in or Create an account to join the conversation.
Time to create page: 0.173 seconds