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

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>
  • 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 Jul 31 '15 at 13:04
  • are you sure that this is not components/com_k2/templates/default/tag.php ? I found the relevant code there. – JoomlaEvolved Development Jul 31 '15 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 Aug 1 '15 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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