What do I understand in Joomla is that until you create a menu for a specific view you will be getting component links to its views, in this manner:

component/component_name/location/new-york (ex #1)

If you create link for this view it should transform to menu alias + view + item name or id, like this:

/locations/location/new-york (ex #2)

However, I did this and I'm still getting an old link like in example #1. Though if I add Itemid to the link I get expected result like in example #2, see below what I mean:

JRoute::_('index.php?option=com_modern_tours&view=location&alias=' . $asset->alias .'&Itemid=138'); this transforms to this /locations/location/new-york

But this

JRoute::_('index.php?option=com_modern_tours&view=location&alias=' . $asset->alias); this transforms to this component/component_name/location/new-york

Seems like in this case I have to create an additional function to search through the menu and add missing itemid. Though I'm unsure if this is really how it should work, or Joomla itself should take of this? Can someone explain this to me, please

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.