Skip to main content

Questions tagged [jroute]

For questions regarding JRoute and its modern name spaced version \Joomla\CMS\Router\Route

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

JRoute not working in my plugin from the backend

I have a weird and strange bug. When I try to use JRoute to prettify my url from Virtuemart it doesn't do anything. Does anyone know how I can fix it? I read somewhere about using the frontend of the ...
Kuubs's user avatar
  • 345
0 votes
1 answer
67 views

Creating site routes from Administrator client

I am in the process of migrating a large Joomla component from v3.x (with lots of legacy code from 1.5+!) to Joomla 5 at present. One item I have stumbled upon is how best to bootstrap the component's ...
John Rix's user avatar
  • 563
4 votes
1 answer
101 views

How to properly add a query parameter to my Router?

Given the following menu entries Route::_('index.php?option=com_mycomponent&view=categories&extension=com_mycomponent.countries') should return '/countries' but in fact it returns '/diseases'....
Alexandre Paulo's user avatar
0 votes
1 answer
315 views

How to catch Joomla\CMS\Router\Exception\RouteNotFoundException in Joomla 4.1?

As per the title, how can we catch a RouteNotFoundException? For time constraints, instead of creating a custom component we opted for some hand-waving, and decided to display custom content at non-...
Vincenzo Oliva's user avatar
1 vote
1 answer
61 views

What is the best way to have pages displaying articles from our custom content table in Joomla 4.1?

Related: Is it possible to make it so that authors can edit their own published articles creating a new unpublished version of them? The answer to that question is "In Joomla 4 it is, but authors ...
Vincenzo Oliva's user avatar
1 vote
0 answers
78 views

Help: Joomla routing and pass-through redirects

I have a little project integrating a 3rd party application, which seems pretty easy and straight forward for the most part. However, it requires some internal Routing to be set in place, in order to ...
curious-george's user avatar
2 votes
2 answers
944 views

JRoute don't make a SEF Url from the article link

When I use Route method to convert a normal url in a SEF url it doesn't work if the article is not a menu item. I don't understand if it's a normal behavior or if I'm doing something wrong. There is ...
Nintendomi's user avatar
2 votes
0 answers
675 views

Joomla 4 - router.php SEF-URLs broken since update

This current router.php creates in Joomla 4 this URL: localhost/component/ohanah/?id=688&Itemid=101 But it should create this: localhost/kurse/688-event-name where "event-name" is the ...
user avatar
0 votes
1 answer
232 views

How to disable Joomla routing by Article ID with any alias but use exact alias only

Joomla use own SEF redirects what drives any variants of URL to same article basing on Article ID (no matter what alias will be used) http://example.com/3-welcome-to-your-blog.html or http://example....
Serge's user avatar
  • 103
0 votes
1 answer
203 views

Joomla custom component - router not find alias

I am creating my own component. Is it possible to transform: Route::_('index.php?option=com_toto&view=tutu') into /somealiasinmenu? (This alias can be found in a menu in the backoffice.) I can do ...
Lecraver's user avatar
2 votes
1 answer
509 views

JRoute not working - always shows the current view

I have created a view for my custom component and it works OK however I've noticed that JRoute only works for the current view. If I am, for example, on the view picture and I try to "JRoute ...
Thiago Guimarães's user avatar
0 votes
1 answer
194 views

JRoute does not show the URL it is supposed to

I have the following problem: I set a URL with JRoute like this: JRoute::_('index.php?option=com_gallery&view=gallery'); This gives me example.site/gallery, which is correct, however, if I ...
Thiago Guimarães's user avatar
1 vote
0 answers
89 views

Joomla routing adding a 'view' query parameter to traffic destined to com_api component

I'm planning a series of APIs to execute in a Joomla instance to provide data to other sites. Experiments ongoing to understand how to implement. Considering com_ajax, com_api or new component. ...
joesboat's user avatar
0 votes
1 answer
82 views

SEF url and custom view

Was able to create a custom component and a custom view which I went ahead and attached a js library to. Now to achieve my desired functionality I need to create a custom url(SEF) in my route.php file,...
Nicholas's user avatar
0 votes
1 answer
436 views

Friendly URL for a custom component

I'm trying to create a friendly URL for a custom component but i can't manage to find a solution. I have tried JRoute but it hasn't worked out for me (probably i'm not doing it right). Does anybody ...
Thiago Guimarães's user avatar
0 votes
0 answers
46 views

JRoute not return specific menu item link

i have developing a custom component. i have a problem: i am in a menu that show view 1. when i use JRoute function for link to view2 that have specific menu item, it return current url and add ?view=...
Reza ghasemi's user avatar
0 votes
1 answer
57 views

Possible to associate item with itself?

I am working on a custom component. Most input are numbers, therefor not translatable. There are also some strings that can be translated. Instead of having the user duplicate each item to a new ...
TVBZ's user avatar
  • 213
1 vote
0 answers
78 views

JRoute::link('site') generates different strings depending on the app context

I'm developing a component in Joomla! 3.9.13 with SEF urls turned ON and I use this line of code JRoute::link( 'site', 'index.php?option=com_mycomponent&task=profile.edit', false, JRoute::...
Rico's user avatar
  • 155
0 votes
1 answer
130 views

Why do we Route url using JRoute or Route namespace? What is the purpose of routing urls?

I want to know the purpose of routing the urls. Can anyone explain me why do we route urls?
user13900's user avatar
1 vote
1 answer
437 views

how to route url - JRoute get wrong itemid and wrong sef url

Joomla 3.9.12, JoomGallery 3.4 I have a site with joomShopping for e-shop and JoomGallery for portfolio. The site has 2 menus where some menu items of the first are menu item aliases of the second. ...
Sergey Tolkachyov's user avatar
2 votes
1 answer
507 views

Create a link from Backend to SEF Path in Frontend

I would like to create a link in Administrator Panel that redirect a user to an SEF url in Frontend. Code in Backend <?php $link = JUri::root() . 'index.php?option=com_content&view=article&...
spiNOops's user avatar
1 vote
0 answers
135 views

How to get SEF URL from JRoute when layout set in menu item

I've set up my component which has one view and several layouts. For each layout I've added a views/myview/tmpl/layoutname.xml file which sets the layout via a hidden variable, like so: <field ...
Dom's user avatar
  • 511
1 vote
1 answer
128 views

What is the purpose of cloning JUri in the CMSApplication route method?

CMSApplicationWhen Joomla does its initial routing in Joomla\CMS\Application\CMSApplication in the route method, the JUri object is cloned. The line is: $uri = clone \JUri::getInstance(); Looking at ...
Dom's user avatar
  • 511
0 votes
1 answer
527 views

"JRoute::_" generating two different urls for same link

So I have this weird problem. I am calling JRoute::_('index.php?option=com_example&view=foo&layout=bar') ..from two different view-layouts. And Joomla! is generating different SEF-URL ...
Mohd Abdul Mujib's user avatar
2 votes
1 answer
483 views

Generating URL in CLI

Can anybody shed some light how to generate an url in Joomla command-line application. Seems that budget was cut off at Joomla routing development because: JRoute::_('index.php?option=...
JohnSmith's user avatar
  • 153
1 vote
1 answer
217 views

Joomla BuildRule adds language code at the back of setPath

I'm having a problem with building the rule for a particular URL. Here's what I have in my system plugin: //... function onAfterInitialise() { require_once '/path/to/myhelper.php'; $router = $...
Mike Feng's user avatar
  • 266
0 votes
1 answer
804 views

Different views on router.php (Joomla! 3.6.4)

I am developing my second custom component for Joomla! 3.6.4 and I have another problem with my router.php. This time I need to dynamically change the view on my router.php but I don’t know how to do ...
OlafGizursson's user avatar
2 votes
1 answer
988 views

JRoute::_('index.php') no longer adds Itemid since Joomla 3.8.4

I have a custom component that handles generates a page containing a list of events, and a page giving details for the event. Previously, I would have one menu item setup to handle the list page: ...
Chaosxmk's user avatar
  • 338
1 vote
1 answer
847 views

Joomla! 3.6.4 router.php for a custom component

I am developing a custom component for Joomla! for the first time and I am stuck on the creation of a router.php. I alredy read the Joomla! Documentation but without clearly understand what to do. ...
OlafGizursson's user avatar
1 vote
0 answers
58 views

How to check if Joomla path is routable

Is there any way to see if a path will route to a component preferably without dispatching it? I can't use CURL or get_headers to see if the status is 200. In other frameworks you can tap into the ...
Eko3alpha's user avatar
  • 131
2 votes
3 answers
2k views

Create SEF URLs from a Custom Component that does not search on database

I am creating a custom component that will get data by json from another url. So far it works good but I am having some difficult trying to apply a SEF URL with a router.php file. Example, current ...
user1967509's user avatar
1 vote
1 answer
631 views

Need some help by custom component routing and menupoints

I am trying to write a custom component router. I have these admin and site uri structures: http://localhost/administrator/index.php?option=com_{component_name}&... and http://localhost/index.php/{...
inf3rno's user avatar
  • 391
1 vote
1 answer
222 views

[com]BuildRoute(&$query) function is called with no $query['view'] member passed

I am writing a component for site side and having some troubles with router. I have 2 views in one component, both them have only one default.php template and default.xml to define menu type for each ...
impulsgraw's user avatar
2 votes
4 answers
8k views

Absolute SEF url with JRoute

I'm trying to figure out why I can't get a correct absolute SEF url with JRoute. I tried with this: JRoute::_(JUri::root().'index.php?Itemid=164') but it won't correctly SEF render it, it will just ...
Gruber's user avatar
  • 302
0 votes
1 answer
877 views

Problem with JRoute::_ and ajax data

I'm making a custom component in Joomla! 3. Let's call it TestCom (com_testcom). What I want is to add to items view a simple searching and filtering engines. For this I've created additional, raw ...
TheNut's user avatar
  • 1
1 vote
2 answers
439 views

SEF URL using router without id in the URL

Non SEF URL http://www.example.com/index.php?option=com_yourcomponent&view=article&id=20&Itemid=50 SEF URL http://www.example.com/example-menu-item/20 Is it possible to create SEF ...
Malaiselvan's user avatar
  • 2,731
2 votes
2 answers
476 views

How to remove IDs from SEF URL in Joomla?

I 'm writing a custom component and I already get done the router.php: defined('_JEXEC') or die; function empresaBuildRoute(&$query) //Esta función divide la url y se trae las variables. { $...
Ignacio Salcedo's user avatar
1 vote
1 answer
69 views

Component doesn't use route Joomla 2.5.28

I'm doing some work on an old joomla website which I can't upgrade at the moment. I have booking component that has a search module which than redirects to component url like this: mysite.com/...
Reygoch's user avatar
  • 273
2 votes
2 answers
658 views

How to change url scheme of Search component?

How can I change the url scheme appearing for Search Component in Joomla. When a search is done url goes like: http://localhost/joomlaproject/component/search/?searchword=destination&...
aish's user avatar
  • 325
3 votes
2 answers
1k views

Using JRoute in the backend? Almost figured it out, help needed

I needed to get JRoute working in backend so that from admin I can create an event with my event component and have an email sent that contains the SEF url. After researching, I found some tips that ...
Brian's user avatar
  • 141
1 vote
0 answers
75 views

Domain url formed issue

I have a problem with how the internal links of a website are formed while using the JRoute class. Instead of them being in the following format: www-mydomain-gr/[the rest of the url] they are ...
pixeldives's user avatar
5 votes
1 answer
156 views

Compose URL from its parts

Is there a method to create URL from different parameters? For example, from: id=1 option=view task=delete to: index.php?id=1&option=view&task=delete
mortalis's user avatar
  • 375
1 vote
0 answers
397 views

Remove /components/ from Popular Tags Cloud module

I have set up a page called domain.com/tags.html on the root which links to the com_tags component and shows a set of tags most used. I also want to use the Popular tag cloud module, mod_tags_popular,...
Anriëtte Myburgh's user avatar
0 votes
2 answers
826 views

Ajax request 303 redirect on a multilingual website

I have an ajax task to return a form token from my controller for use in ajax pages, so that subsequent ajax requests will have a token. It looks like this in the code: JURI::root().'index.php?option=...
user101289's user avatar
  • 1,119
2 votes
3 answers
1k views

Joomla 3 with k2 sef url issue

I have an issue with k2 sef settings. I want all items to have no category structure, example: http://example.com/cat1/cat2/item1 -> http://example.com/item1 I found the setting: Prefix for item ...
Coen Ponsen's user avatar
2 votes
1 answer
1k views

Paginated links on items generated using a custom search module does not work

I am trying to build a component called com_usedbooks with a module called mod_usedsearch. The user can view books by clicking a Menu Item called 'Used Books' (/used-books) which will show a paginated ...
sifu's user avatar
  • 1,105
7 votes
3 answers
5k views

404 HTTP codes in Joomla

how do you make Joomla return a "real" 404 code? I can't figure out how to make this happen! I have changed htaccess.txt to .htaccess, enabled the system / redirect plugin, and turned on rewrite URLs ...
user101289's user avatar
  • 1,119
2 votes
1 answer
101 views

Is this a route loop?

Our site (Joomla 2.5.8) is using the Document Seller component/module (I'm not clear on the proper use of these terms in the Joomlaverse) to categorize and sell a series of PDF documents. The ...
pjmorse's user avatar
  • 151
1 vote
1 answer
395 views

Attributing Itemid to article when opened from a "Tagged Items" pages

I am struggling with the tag component. 1) When I click on the title of an article from the component/tags/tag/MyTag page, then I am redirected to a page with the home itemid. This is a big issues ...
MagTun's user avatar
  • 976
4 votes
1 answer
935 views

Link to content article with specific layout

I'm trying to link to a content article and force a specific layout override to be used in the display, however I'm having some troubles. I've tried the following: JRoute::_("index.php?option=...
jonasfh's user avatar
  • 738