0

I want to exclude K2 tag pages from being indexed by search engine by adding

$document = & JFactory :: getDocument();
$document->setMetaData('robots', 'noindex');

to it's controller/view code. For some reason I can't find tag view or controller, from what I can gather it seems like it is merget with some other file.

There is /components/com_k2/templates/default/tags.php and /components/com_k2/views/itemlist/tmpl/tag.php but it doesn't seem like the thing I'm looking for.

1 Answer 1

-1

Try in:

components/com_k2/templates/default/item.php

Basically, if you grep the code for the relevant language Field, K2_TAGGED_UNDER, you will see that there is relevant code in:

./templates/default/item.php:366:                 
<span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>

./templates/default/user.php:199:
<span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>

./templates/default/latest_item.php:104:
<span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>

./templates/default/category_item.php:193:
<span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>
3
  • I'm actually looking for a code that displays tag results (when you click on a tag and than you get all articles related to that tag) and not tags related to articles.
    – Reygoch
    Commented Jul 31, 2015 at 13:04
  • are you sure that this is not components/com_k2/templates/default/tag.php ? I found the relevant code there. Commented Jul 31, 2015 at 22:16
  • Yes, I made a mistake. I had some caching problems and change didn't present it self so I figured I'm looking at the wrong place.
    – Reygoch
    Commented Aug 1, 2015 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.