COMMUNITY FORUM
Categories Routes :-(
- Javi Mata
-
Topic Author
- Offline
- Senior Member
Less
More
9 years 2 months ago #151512
by Javi Mata
Twitter: @Javi_Mata
Web: www.javimata.com
Categories Routes :-( was created by Javi Mata
I, i'm create a Module for a list of categories but i have problems with the routes, i try use the Route.php native of K2 and use this:
$item->categoryLink = JRoute::_(K2HelperRoute::getCategoryRoute($item->id.':'.urlencode($item->alias)));
and i receive this: web.com/emprendimiento/itemlist/category/2-emprendimiento
where emprendimiento is the alias and 2 the id, this is ok but i need just see web.com/emprendimiento
what need change or what can i do it? thanks
$item->categoryLink = JRoute::_(K2HelperRoute::getCategoryRoute($item->id.':'.urlencode($item->alias)));
and i receive this: web.com/emprendimiento/itemlist/category/2-emprendimiento
where emprendimiento is the alias and 2 the id, this is ok but i need just see web.com/emprendimiento
what need change or what can i do it? thanks
Twitter: @Javi_Mata
Web: www.javimata.com
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Moderator
Less
More
- Posts: 8743
9 years 2 months ago #151516
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Categories Routes :-(
Hi,
You need to either create a menu link to this category or enable the advanced SEF in K2 parameters. Note that in the second case, all the K2 links of your site will changed, not just the categories links.
Let me know if you need more help.
You need to either create a menu link to this category or enable the advanced SEF in K2 parameters. Note that in the second case, all the K2 links of your site will changed, not just the categories links.
Let me know if you need more help.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Javi Mata
-
Topic Author
- Offline
- Senior Member
9 years 2 months ago #151542
by Javi Mata
Twitter: @Javi_Mata
Web: www.javimata.com
Replied by Javi Mata on topic Categories Routes :-(
i have a menu with this categories, how can i get the real link or the menu link for each category in my module?
thanks
thanks
Twitter: @Javi_Mata
Web: www.javimata.com
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 2 months ago #151546
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Categories Routes :-(
The link (since each category is mapped to a separate menu item) should be automatically generated from that module.
If the module is not picking the route correctly, you need to contact the module's developer.
If the module is not picking the route correctly, you need to contact the module's developer.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Javi Mata
-
Topic Author
- Offline
- Senior Member
9 years 2 months ago #151548
by Javi Mata
Twitter: @Javi_Mata
Web: www.javimata.com
Replied by Javi Mata on topic Categories Routes :-(
i'm the module developer :-S
Twitter: @Javi_Mata
Web: www.javimata.com
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 2 months ago #151549
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Categories Routes :-(
If that's the case (kudos as well for developing for K2) you can base your module on our K2 Content module. There is no need to reinvent the wheel :)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Javi Mata
-
Topic Author
- Offline
- Senior Member
9 years 2 months ago #151557
by Javi Mata
Twitter: @Javi_Mata
Web: www.javimata.com
Replied by Javi Mata on topic Categories Routes :-(
i need select some categories and show the title and description for the selected categories and i can't do it with the K2 Content Module
Twitter: @Javi_Mata
Web: www.javimata.com
Please Log in or Create an account to join the conversation.
- Javi Mata
-
Topic Author
- Offline
- Senior Member
9 years 2 months ago #151598
by Javi Mata
Twitter: @Javi_Mata
Web: www.javimata.com
Replied by Javi Mata on topic Categories Routes :-(
i don't know if this is try to reinvent the wheel, i can't do it with the preset modules
i put my custom module based in the k2_content, in this put the route directly using the alias :-S
github.com/javimata/mod_k2_categories
i put my custom module based in the k2_content, in this put the route directly using the alias :-S
github.com/javimata/mod_k2_categories
Twitter: @Javi_Mata
Web: www.javimata.com
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Moderator
Less
More
- Posts: 8743
9 years 2 months ago #151604
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Categories Routes :-(
@Javi Mata
You are passing the item id in the function getCategoryRoute while it expects the category id.
You are passing the item id in the function getCategoryRoute while it expects the category id.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Javi Mata
-
Topic Author
- Offline
- Senior Member
9 years 2 months ago #151613
by Javi Mata
Twitter: @Javi_Mata
Web: www.javimata.com
Replied by Javi Mata on topic Categories Routes :-(
i create the query for a categories list and save the result in $items, so, in the foreach $item->id is the category id really?
Twitter: @Javi_Mata
Web: www.javimata.com
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 2 months ago #151616
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Categories Routes :-(
Without knowing your code, $item->id will produce the category;s link.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.