I'm developing a module for displaying list of articles. In order to find the URL of an article I use ContentHelperRoute::getArticleRoute($item->slug, $item->catid). By default, it returns the article link (OK) but if it finds a menu item linking to this article It returns this menu item link.
This is my scenario:
- I have an article "My article".
- I have 2 menus "Main menu" (I created if first) and "Special menu".
- On each menu, I have a menu item linking to the same article but they are displayed with a different layout.
- In "Main menu", I have a menu item "Default article" using the default layout.
- In "Special menu", I have a menu item "Special article" using a customized layout.
It seems that ContentHelperRoute::getArticleRoute($item->slug, $item->catid) returns the link to "Default article". How can I get the link to "Special article"? Is there a way to get the link from the menu "Special menu" instead of "Main menu"?