- Posts: 7
COMMUNITY FORUM
SOLVED Get Breadcrumbs to work w K2 Content Module
- arien101
-
Topic Author
- Offline
- New Member
Less
More
13 years 1 day ago - 12 years 11 months ago #65397
by arien101
SOLVED Get Breadcrumbs to work w K2 Content Module was created by arien101
I have K2 items in a category structure and I use the standard Joomla module for showing breadcrumbs. When I navigate to an item using the category structure I get perfect breadcrumbs like I want them. All good.
On the homepage, however, I have a K2 Content Module that shows the most recent items. When I click through to the item from this K2 Content Module no breadcrumbs are shown (only the Home icon).
I guess this is because the link structure is different:
This URL shows breadcrumbs as expected:
www.widgets.com/en/maincategory/subcategory/item/3-widgetitem
This URL doesn't:
www.widgets.com/en/component/k2/item/3-widgetitem
Does anybody know how to show the breadcrumbs for the item like they would be shown if it was in a category?
Haven't found an answer through using the forum search.
Any help would be greatly appreciated!
On the homepage, however, I have a K2 Content Module that shows the most recent items. When I click through to the item from this K2 Content Module no breadcrumbs are shown (only the Home icon).
I guess this is because the link structure is different:
This URL shows breadcrumbs as expected:
www.widgets.com/en/maincategory/subcategory/item/3-widgetitem
This URL doesn't:
www.widgets.com/en/component/k2/item/3-widgetitem
Does anybody know how to show the breadcrumbs for the item like they would be shown if it was in a category?
Haven't found an answer through using the forum search.
Any help would be greatly appreciated!
Please Log in or Create an account to join the conversation.
- arien101
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 7
13 years 1 minute ago #65398
by arien101
Replied by arien101 on topic Re: Getting Breadcrumbs to work with K2 Content Module
Ok, I think I've homed in on the problem and I definitely have a solution, although it involves some manual work.
Apparently the reason why the bradcrumbs don't work is that the categories and items in question do not have a Joomla ItemID. If my limited understanding of Joomla is correct the only way to get an ItemID is to assign something to a menu (please correct me if I'm wrong here).
So, once each K2 category and K2 Item is assigned to a menu they all get Joomla ItemIDs. Now when a URL is called that includes the ItemID everything is fine and the breadcrumbs display. Unfortunately the K2 Content Module still links directly to the K2 ID and so again, no ItemID is present and no breadcrumb is shown.
This I fixed by installing the sh404SEF extension. What that does is basically merge all the various URLs that point to the same item. So no more different URLs for the same content (as in my initial example above). Now there is one final step to take: sh404SEF automatically chooses one of the various URLs that point to one item to be the "main" URL. If it has made the URL without the ItemID "main" than still no breadcrumbs are shown. In this case all you need to do is go into the sh404SEF URL manager and set the URL with the ItemID to "main". And voilá, all your categories and items now show the correct breadcrumb path.
As this fix is quite labor intensive I have one more question for the K2 pros: Is there a way to automatically have K2 generate Joomla ItemIDs for each category and item? That way the step of adding all items and categories to a menu would be unnecessary for those of us who don't actually want to use menus for navigating to the items.
Apparently the reason why the bradcrumbs don't work is that the categories and items in question do not have a Joomla ItemID. If my limited understanding of Joomla is correct the only way to get an ItemID is to assign something to a menu (please correct me if I'm wrong here).
So, once each K2 category and K2 Item is assigned to a menu they all get Joomla ItemIDs. Now when a URL is called that includes the ItemID everything is fine and the breadcrumbs display. Unfortunately the K2 Content Module still links directly to the K2 ID and so again, no ItemID is present and no breadcrumb is shown.
This I fixed by installing the sh404SEF extension. What that does is basically merge all the various URLs that point to the same item. So no more different URLs for the same content (as in my initial example above). Now there is one final step to take: sh404SEF automatically chooses one of the various URLs that point to one item to be the "main" URL. If it has made the URL without the ItemID "main" than still no breadcrumbs are shown. In this case all you need to do is go into the sh404SEF URL manager and set the URL with the ItemID to "main". And voilá, all your categories and items now show the correct breadcrumb path.
As this fix is quite labor intensive I have one more question for the K2 pros: Is there a way to automatically have K2 generate Joomla ItemIDs for each category and item? That way the step of adding all items and categories to a menu would be unnecessary for those of us who don't actually want to use menus for navigating to the items.
Please Log in or Create an account to join the conversation.
- Mike
-
- Offline
- New Member
Less
More
- Posts: 3
12 years 11 months ago #65399
by Mike
Replied by Mike on topic Re: SOLVED Get Breadcrumbs to work w K2 Content Module
I thought this was going to be my solutions, but I think I figured it out. Try creating a sub-menu item located under your parent menu item. Then make sure you link all your modules to the new sub-menu item.
Look at this post for more details. I hope it helps.
getk2.org/community/New-to-K2-Ask-here-first!/9161-Associate-an-itemID-with-K2-Content-module#12013
Look at this post for more details. I hope it helps.
getk2.org/community/New-to-K2-Ask-here-first!/9161-Associate-an-itemID-with-K2-Content-module#12013
Please Log in or Create an account to join the conversation.
- Levon Dalakyan
-
- Offline
- New Member
Less
More
- Posts: 1
12 years 7 months ago #65400
by Levon Dalakyan
Replied by Levon Dalakyan on topic Re: Getting Breadcrumbs to work with K2 Content Module
Brilliant! It solved my problem. sh404 is really must have. In this case it solves 2 problems at once - duplicate content and wrong Itemid. Breadcrumb module needs proper Itemid (menu item) to show.
Please Log in or Create an account to join the conversation.