- Posts: 157
COMMUNITY FORUM
K2 Breadcrumb and SEF URL
- Goble002
-
Topic Author
- Offline
- Premium Member
Less
More
8 years 8 months ago - 8 years 8 months ago #157696
by Goble002
K2 Breadcrumb and SEF URL was created by Goble002
Hello,
Running K2 v2.7.1 and J! v3.6.2.
I'm looking for a way to get breadcrumb and URL to display the 'normal' way like hereunder. I’m using both K2 Breadcrumb & Joomla Breadcrumb to see which one will work better.
Noting that in this example “sub cat” is a sub category using 2 words with alias “sub-cat”
Ideally how it should look:
- On item page: Breadcrumb: Home > Cat > Sub cat > K2 Item and SEF URL: mywebsite.com/cat/sub-cat/k2-item
- On sub-cat page: Home > Cat > Sub cat and SEF URL: mywebsite.com/cat/sub-cat
- On cat page: Home > Cat and SEF URL: mywebsite.com/cat
If I create a Menu for ‘k2 categories’ for Cat (Main Category) only, these are the results:
1. When I navigate on item page using my Menu for ‘k2 categories’, then choose ‘sub cat’ on that page, then choose item on the sub-cat page.
Results : Breadcrumb: Home > Cat > Sub cat > K2 Item and SEF URL: mywebsite.com/cat/sub/k2-item (the only issue here is that URL is showing only 1st part of the alias ‘sub-cat’)
2. When I navigate on sub cat page using my Menu for ‘k2 categories’, then choose ‘sub cat’ on that page OR make use of breadcrumb
Results : Breadcrumb: Home > Cat > Sub cat and SEF URL: mywebsite.com/cat/content/sub-cat (the only issue here is that URL is now adding ‘content’ however ‘sub-cat’ is now displaying correctly)
3 (a) When I navigate on cat page (using my Menu for ‘k2 categories’)
Results : Breadcrumb: Home > Cat and SEF URL (is no more SEF) : mywebsite.com/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=2
3 (b) When I navigate on cat page using breadcrumb
Results : Breadcrumb: Home > Cat and SEF URL: mywebsite.com/cat (everything’s perfect here)
I was thinking of rewriting the URLs in htaccess since the item URL exist for example :
redirect mywebsite.com/cat/sub/k2-item to mywebsite.com/cat/sub-cat/k2-item
But sub-cat URL won’t exist and hereunder will provide 404 errors.
redirect mywebsite.com/cat/content/sub-cat to mywebsite.com/cat/sub-cat
P.S If I create Menus for ‘k2 categories’ for Cat and another for sub cat only, then everything will become a mess.
Results for sub cat will be : Breadcrumb: Home > Sub cat and SEF URL: mywebsite.com/sub-cat
k2 parameters snapshot: imgur.com/a/giZss , site is not online actually.
Thanks for any input
Running K2 v2.7.1 and J! v3.6.2.
I'm looking for a way to get breadcrumb and URL to display the 'normal' way like hereunder. I’m using both K2 Breadcrumb & Joomla Breadcrumb to see which one will work better.
Noting that in this example “sub cat” is a sub category using 2 words with alias “sub-cat”
Ideally how it should look:
- On item page: Breadcrumb: Home > Cat > Sub cat > K2 Item and SEF URL: mywebsite.com/cat/sub-cat/k2-item
- On sub-cat page: Home > Cat > Sub cat and SEF URL: mywebsite.com/cat/sub-cat
- On cat page: Home > Cat and SEF URL: mywebsite.com/cat
If I create a Menu for ‘k2 categories’ for Cat (Main Category) only, these are the results:
1. When I navigate on item page using my Menu for ‘k2 categories’, then choose ‘sub cat’ on that page, then choose item on the sub-cat page.
Results : Breadcrumb: Home > Cat > Sub cat > K2 Item and SEF URL: mywebsite.com/cat/sub/k2-item (the only issue here is that URL is showing only 1st part of the alias ‘sub-cat’)
2. When I navigate on sub cat page using my Menu for ‘k2 categories’, then choose ‘sub cat’ on that page OR make use of breadcrumb
Results : Breadcrumb: Home > Cat > Sub cat and SEF URL: mywebsite.com/cat/content/sub-cat (the only issue here is that URL is now adding ‘content’ however ‘sub-cat’ is now displaying correctly)
3 (a) When I navigate on cat page (using my Menu for ‘k2 categories’)
Results : Breadcrumb: Home > Cat and SEF URL (is no more SEF) : mywebsite.com/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=2
3 (b) When I navigate on cat page using breadcrumb
Results : Breadcrumb: Home > Cat and SEF URL: mywebsite.com/cat (everything’s perfect here)
I was thinking of rewriting the URLs in htaccess since the item URL exist for example :
redirect mywebsite.com/cat/sub/k2-item to mywebsite.com/cat/sub-cat/k2-item
But sub-cat URL won’t exist and hereunder will provide 404 errors.
redirect mywebsite.com/cat/content/sub-cat to mywebsite.com/cat/sub-cat
P.S If I create Menus for ‘k2 categories’ for Cat and another for sub cat only, then everything will become a mess.
Results for sub cat will be : Breadcrumb: Home > Sub cat and SEF URL: mywebsite.com/sub-cat
k2 parameters snapshot: imgur.com/a/giZss , site is not online actually.
Thanks for any input
Last edit: 8 years 8 months ago by Goble002.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 8 months ago #157716
by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Breadcrumb and SEF URL
Joomla!'s breadcrumbs will display the menu path, regardless of K2 categories and subcategories.
K2 Tools will display K2's full path, even if there are no menu items assigned to a category or its children.
Keeping that in mind you can build your menus either by mapping each of your categories into a separate menu item which will will result into /parent-cat/sub-cat/item menus or, you can use K2's advanced SEF and use (only the last) category as a prefix.
Alternatively you can map only the top level(s) and leave the last URL token to be generated by K2's advanced SEF.
K2 Tools will display K2's full path, even if there are no menu items assigned to a category or its children.
Keeping that in mind you can build your menus either by mapping each of your categories into a separate menu item which will will result into /parent-cat/sub-cat/item menus or, you can use K2's advanced SEF and use (only the last) category as a prefix.
Alternatively you can map only the top level(s) and leave the last URL token to be generated by K2's advanced SEF.
Please Log in or Create an account to join the conversation.
- Goble002
-
Topic Author
- Offline
- Premium Member
Less
More
- Posts: 157
8 years 8 months ago #157751
by Goble002
Replied by Goble002 on topic K2 Breadcrumb and SEF URL
Hello and thanks Krikor,
just to let you know that I was using mega menu and all aliases got messed up.
Everything is now perfect with classic main menu.
just to let you know that I was using mega menu and all aliases got messed up.
Everything is now perfect with classic main menu.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 8 months ago #157763
by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Breadcrumb and SEF URL
Nice to hear that the issue has been resolved :)
Please Log in or Create an account to join the conversation.