×
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 个月 3 天 前 #10304
由 Matt Jackson
Router - Linking to Component Creator pages not picking up Route was created by 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!
Please 登录 或 注册一个帐号 to join the conversation.
创建页面时间:0.045秒