×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Router - Linking to Component Creator pages not picking up Route
Matt Jackson
New Member
Posts: 2
4 Mesi 3 Settimane fa #10304
da Matt Jackson
Router - Linking to Component Creator pages not picking up Route è stato creato da Matt Jackson
I have a problem which may be user error on my end but I have a client site with several custom components built using Component Creator lets say com_bookings and com_contacts.
If I use this in my tmpl view whilst in com_bookings:
Route::_('index.php?option=com_bookings&view=calendar')
That will generate the correct SEF link becuase I am using the Route whilst in the component (for example on the my bookings page). This is great!
However, when I want to link to another view that is in another component - lets say Route::_('index.php?option=com_contact&view=myenquiries') Then the Route wont pick up the menu item that exists for that page and instead will do a bad SEF link like "component/contact/myenquiries&Itemid=123" (Where 123 in the Homepage of the website).
Currently I am having to hardcode the URLs in the view when linking between platforms, but I would much rather use Joomla routing to make this work. Do I need to code up a script that firstly looks through all the menu items to see if there is a match for that component to then get the ItemId for example? Or is there a built in Route::_ function I can use to get this going?
Perhaps there is an update that I can make in the Router.php file that comes bundled with the exported component?
Any help would be greatly appreciated. Thanks in advance!
If I use this in my tmpl view whilst in com_bookings:
Route::_('index.php?option=com_bookings&view=calendar')
That will generate the correct SEF link becuase I am using the Route whilst in the component (for example on the my bookings page). This is great!
However, when I want to link to another view that is in another component - lets say Route::_('index.php?option=com_contact&view=myenquiries') Then the Route wont pick up the menu item that exists for that page and instead will do a bad SEF link like "component/contact/myenquiries&Itemid=123" (Where 123 in the Homepage of the website).
Currently I am having to hardcode the URLs in the view when linking between platforms, but I would much rather use Joomla routing to make this work. Do I need to code up a script that firstly looks through all the menu items to see if there is a match for that component to then get the ItemId for example? Or is there a built in Route::_ function I can use to get this going?
Perhaps there is an update that I can make in the Router.php file that comes bundled with the exported component?
Any help would be greatly appreciated. Thanks in advance!
Si prega Accedi o Crea un account a partecipare alla conversazione.
Tempo creazione pagina: 0.048 secondi