× 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

3 meses 3 semanas antes #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, Identificarse o Crear cuenta para unirse a la conversación.

Tiempo de carga de la página: 0.054 segundos
Gracias a Foro Kunena

Utilizamos cookies propias y de terceros para mejorar nuestros servicios y mostrarle publicidad relacionada con sus preferencias mediante el análisis de sus hábitos de navegación. Si continua navegando, consideramos que acepta su uso.