× 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

1 mês 2 semanas atrás #10304 por 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!

Por favor Acessar ou Registrar para participar da conversa.

Tempo para a criação da página:0.062 segundos
Powered by Fórum Kunena

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.