Getting links URLs for categories with custom layouts using JRoute

18 views
Skip to first unread message

Elvis

unread,
Feb 7, 2018, 8:14:17 AM2/7/18
to Joomla! General Development
I stumbled upon strange behavior when trying to generate URLs for com_content categories and their children.
I have custom layouts for categories and all content structure is build with menus, so itemid-s are there.
But when I try to generate URLs (links) for example inside module using JRoute::_(ContentHelperRoute::getCategoryRoute) and getChildren(), layout parameter is missing in URL.

So instead of 
index.php?option=com_content&view=category&layout=uikit2:catalog&id=108&Itemid=825
I get
index.php?option=com_content&view=category&id=108&Itemid=825

I've found a post on stackoverlow saying that it isn't possible to generate categories and categories children URLs with custom layouts and JRoute, is it true?









Reply all
Reply to author
Forward
0 new messages