Keyword

All instances of tag link to tag menu item

  • bkemler
  • bkemler's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 11 months ago #73671 by bkemler
I'm pretty sure this is a bug but if not, please let me know what settings to change to fix it.

I've created a few menu items by tag and now every instance of those tags link to the menu items, instead of retaining the Itemid of the page where the link is. This is both tags on item pages and tags in the tag cloud of the k2_tools module.

Not only is this a problem because it will hop someone over into a different section of the menu but also... some of the menu items by tag are restricted to certain categories... so you can end up in a completely different section of the site and also only have a subset of the posts with that tag.

Please Log in or Create an account to join the conversation.

More
14 years 11 months ago #73672 by Lefteris
Replied by Lefteris on topic All instances of tag link to tag menu item
Hi. This is how it works and of course how it should works. If you have a menu link to a tag then all the links from this tag should go on the same page. This is very reasonable as you don't want to end up with two or more different pages displaying the same content. Also this is how all components for Joomla! work. So this cannot be accepted as a bug.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • bkemler
  • bkemler's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 11 months ago #73673 by bkemler
Replied by bkemler on topic All instances of tag link to tag menu item
Okay, I guess that makes sense for the menu items that are only filtered by tag but it's a problem for the ones that are filtered by tag and category. On the site I'm building, you can be reading posts in a specific category and click on a tag and it will take you to a page that's filtered by that tag and a completely different category (if such a menu item exists). This seems like a pretty counter-intuitive outcome on the front end.

I'll try making a menu item that's filtered by just the tag and put it higher than the menu item that's sorted by tag and category. Maybe that will make the tag link to the one that's just the tag?

Really, this wouldn't be a problem for me if the content module had the ability to filter by tag. The menu items that are filtered by tag and category aren't actually in the menu- I made them so that I could use the Component as Content plug-in to insert multiple different instances of content filtered by tag and category into a K2 item. I guess I'll go repost my request for that feature in the content module.

Lefteris Kavadas said:Hi. This is how it works and of course how it should works. If you have a menu link to a tag then all the links from this tag should go on the same page. This is very reasonable as you don't want to end up with two or more different pages displaying the same content. Also this is how all components for Joomla! work. So this cannot be accepted as a bug.

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #73674 by Casper Voogt
Replied by Casper Voogt on topic All instances of tag link to tag menu item
In my case, I use only tags, which I link to from my menu. So each tag has its own Itemid, which is fine. However, when you click on "read more" for any of the items on the generic tag page, the 'read more' link uses the default K2 Itemid rather than the Itemid of the current page / menu item. This does seem like a bug to me. The read more links should use the Itemids of the current page or at least the menu item that brought the viewer to that 'read more' link. 

 

I have written a small override that solved this for me, since I could find no other way to solve this.

 

In /components/k2/models/item.php around line 62 (search for "read more link" .. it should be the first one), add this:

//mod to replace K2 Itemid with current page's Itemid. 

if(JRequest::getVar('Itemid') && JRequest::getVar('layout') && (JRequest::getVar('layout') == 'generic') && JRequest::getVar('task') && (JRequest::getVar('task') == 'tag')){

//MAKE SURE TO CHANGE "Itemid=17" TO WHATEVER ITEMID YOUR K2 USES:

$link = str_replace('Itemid=17','Itemid='.JRequest::getInt('Itemid'),$link);

}

 

//end

 

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum