Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [router]

The router creates and interprets nice Search Engine Friendly URLs

Filter by
Sorted by
Tagged with
0 votes
1 answer
50 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
  • 551
1 vote
0 answers
56 views

Can I use uppercase in Joomla 4 url paths?

In Joomla 3 it was possible to use an URL of this form example.com/Essays/somethin-else because the router would match 'Essays' to the alias of an existing menu item (eg. 'essays, content, single ...
user1104799's user avatar
1 vote
0 answers
55 views

Why is my rewriterule not working in Joomla 4

I am using Joomla 4. I have a requirement to rewrite certain URLs to a specific article (article with ID 32). This worked OK with Joomla 3 but now I am getting unexplained error 404 using the same ....
user1104799's user avatar
0 votes
1 answer
152 views

Joomla 4 Router parse function

I'm converting a custom component from Joomla 3, where the component was using the legacy router, to Joomla 4 router. I have the router service set up and working on Joomla 4.4.0. I first tried ...
James Wadsworth's user avatar
0 votes
1 answer
38 views

J4 -Custom Component - Router Unknown $pk in model

I've added Router Features today to my Custom Component - all works finde beside the fact that the $pk variable inside the model holds a curios value (202n) where 'n' is different for each element... ...
Marco's user avatar
  • 685
0 votes
1 answer
204 views

Route not working properly on J4?

I have a menu entry like so: ID: 524 Type: Articles->Create Article Link: index.php?option=com_content&view=form&layout=edit In the "old days" I'do Route::_('index.php?option=...
Alexandre Paulo's user avatar
0 votes
1 answer
93 views

Joomla 4 Router forward to Controller function

For a Joomla 4 component I just cannot figure out how to successfully forward or call a Controller function from within a custom Router. This is the Controller - it basically loads an image: <?php ...
cappu's user avatar
  • 139
0 votes
1 answer
106 views

Joomla 4 Component SEF URL not working for detail page of the item when catid is added in the url

Below is the have written the code router file in the component namespace Test\Component\Test\Site\Service; // No direct access defined('_JEXEC') or die; use Joomla\CMS\Component\Router\...
user4571727's user avatar
0 votes
1 answer
50 views

Using Legacy router while offering API access for own component

I think this could be a bit complicated. I have a non namespaced Joomla 4 component, but i need to have an API access for specific data. So i created a /src directory in Backend with all needed ...
maidan's user avatar
  • 433
1 vote
1 answer
166 views

Joomla 4: no need for Route::_($url)?

I am using this on a custom component: $url = index.php?option=com_content&view=article&catid=427&id=15106 Both echo $url; echo Route::_($url); will output a friendly url. I'm guessing ...
Alexandre Paulo's user avatar
1 vote
0 answers
38 views

multiple parents in router for a view

i need have multiple parents for a view, for example: view products list of all products with links to single product view categories list of all categoires with links to single category View ...
Francesco Reitano's user avatar
0 votes
0 answers
77 views

How to remove a parameter name from url with Joomla 4 router

My current working url is example.com/order/?id=abcd&pass=1234 I want url like example.com/order/abcd?pass=1234 After applying below codes in ROOT/components/com_shop/src/Service/Router.php public ...
Russell's user avatar
  • 13
2 votes
1 answer
676 views

J4 component URL not SEF

Context: I have a component that works fine in J3 and I want to migrate it to J4. Problem: When I create a menu (Joomla main menu) on the frontend view of the component, in J4 only, the URL is not SEF ...
Yann's user avatar
  • 41
2 votes
1 answer
242 views

Joomla 3.x routing and slug problem

I have 1 component with 2 views - default is view1 - secondary is view2. When I associate it with the menu from the backend, Joomla creates the correct url with alias for SEO. Example: www.sitename....
Orazio D'Arrigo's user avatar
0 votes
1 answer
305 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
0 votes
1 answer
891 views

Joomla 4: Error when I use getArticleRoute

In Joomla 4, when I use "RouteHelper::getArticleRoute", I get the next error: "Attempted to load class RouteHelper from namespace Joomla\Component\Content\Site\Helper. I want to use ...
Jon's user avatar
  • 1
3 votes
2 answers
2k views

Joomla 4 URL processing/routing

I have a Joomla extension running on 3.10 which fails on Joomla 4. The issue is that it generates URLs of the form /index.php?option=COMPONENT&view=VIEW&task=TASK&parameter=PARAM which ...
John B's user avatar
  • 51
1 vote
0 answers
77 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
1 vote
0 answers
198 views

Removing the Category ID from article Url

Joomla 3.7(?) to 3.10.5 Legacy router issue fix So, our site articles' urls needed the category id to be removed (only, not the article id, as removing both causes a 404). Here is the solution that ...
Mayou Nkensa's user avatar
1 vote
0 answers
63 views

Migrating from Joomla 3 to Joomla 4 router alias problem

In my old router.php file at function COMPOENTParseRoute($segments), I get "404 Page not found". The error is caused by line 153 of /libraries/src/Router/Router.php. If I create the new ...
Sabin's user avatar
  • 21
3 votes
2 answers
2k views

Joomla 4 no longer inserting the Itemid, the current or active menu , in the URL. Is this correct behavior?

I am not seeing the &Itemid=, the active menu, being added to the URL in Joomla4 like it is with Joomla3. Is this normal behaviour now with Joomla4 and what is the alternative or is it an issue? ...
Irata's user avatar
  • 3,947
1 vote
1 answer
2k views

Router for Joomla 4

I cannot find any documentation on router changes for Joomla 4. Can anyone advise? It appears that placing a router.php file in the base directory for the component still works - although not in ...
mbrampton's user avatar
  • 314
2 votes
0 answers
665 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
61 views

Login Error Joomla 2.5

There is some issue on my site when users visit directly http://spcrepsite.com (without www.) it works accurately, But when http://www.spcrepsite.com (include www.) it will show (homepage) that page ...
Adeel Javed's user avatar
1 vote
1 answer
138 views

Router, keep only item alias in SEF URL

For a particular reason, I need to keep in the SEF URL only the alias of the item to have a URL like this www.mywebsite.com/**myItemAlias** but of course without creating a direct menu to the item ...
Laurent's user avatar
  • 23
0 votes
1 answer
361 views

Joomla router file with fragment(# parameter in URL) in a custom component

How can I get & set the fragment(# parameter in URL) in the URL with the Joomla's existing build & parse method in the router file of the custom component?
learnNewThingAlways's user avatar
0 votes
1 answer
200 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
0 votes
0 answers
92 views

Custom component: different redirect when changing language/logging in

I inherited a site with a custom component: an agenda viewer. When I click on an agenda-item from the list and then login (via login module) or change the language, I am not redirected to the agenda ...
jansen's user avatar
  • 1
0 votes
1 answer
78 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
82 views

Get the option and view values of a SEF url (i.e. the internal url)

I'm developing a Joomla! 3.9.x component and have written a custom com_myusers component. I want to avoid that people login/reset/remind using the standard com_users component and I thought the best ...
Rico's user avatar
  • 155
2 votes
2 answers
705 views

Using JRoute to generate component SEF URL without a menu item id

Currently JRoute generates URLs for my component which look like this https://mysite.com/component/mycomponent/xxx, where I'm handling xxx in my component's router. Instead I'd like JRoute to generate ...
Dom's user avatar
  • 512
0 votes
1 answer
953 views

Find Article SEF URL by ID

Is it possible to get SEF URL from Joomla article ID through some API? I'm moving data from old custom CMS to Joomla. Articles in old CMS contain links to each other. Old articles had their full URL ...
Reygoch's user avatar
  • 273
0 votes
1 answer
57 views

Can't open edit module, get error from JRouter::getInstance('site') in joomla 3.9.x

I have the code: $uri = JUri::getInstance(); $router = JRouter::getInstance('site'); $vars = $router->parse($uri); I'm wanting to parse the uri out at the module's backend (Just the module I'm ...
pdutie94's user avatar
1 vote
0 answers
85 views

New Joomla Router: Adding additional item type views

I have a requirement to support two different types of views. Example views are like below. |_ Items |__ Item |_ Another Items |__Another Item So I am registering the views in the router as below. ...
Nagarjun's user avatar
  • 3,001
0 votes
1 answer
115 views

Generate link to a page with specific language

Lets say I have a menu pointing to an article translated to both english and spanish. How can I generate a link to the english page from the spanish translation? I want to put a notice in all the ...
Cesar's user avatar
  • 101
2 votes
1 answer
479 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
2 answers
515 views

How to link article to specific menu item?

I have two menu items, for example Menu1 and Menu2. Both are a Category Blog for same category Cat1, but Menu1 has some specified tags. Of course, some articles are present on both pages, and all url'...
AnkIF's user avatar
  • 53
1 vote
1 answer
215 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
2 votes
1 answer
99 views

New Router // Nesting, Unique URLs and Multi Parent View Hierarchy

I'm looking for documentation about the new Router arrived in Joomla 3.8/4.0. I already spend some time to figure out how to leverage this new implementation approach to my component and stumbled upon ...
Sven Bluege's user avatar
3 votes
0 answers
251 views

Joomla 3.8 // New Router & Nested View

I want to use the new router classes to implement SEF stuff. I still struggle to get it to work. I have a view which can show categories. So this view is called categories. If you click a category, ...
Sven Bluege's user avatar
1 vote
2 answers
2k views

Remove /component/ from URL generated from module for a custom component

I have created a custom component with routing that seems to be mostly correct and have now created a module to display multiple items of the component on the homepage. I have got it to a point where ...
Alex Mehan's user avatar
1 vote
0 answers
128 views

URL Not Working When SEF is Disabled in Joomla 3.0 Custom Component

I am developing custom component for joomla 3.x. Our urls for non-sef views are not working url: index.php?option=com_mycomponent&view=myview2&id=mycustomeitemid The same url when sef is ...
Dharmesh Chaudhary'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
0 votes
1 answer
190 views

Extend the JRoute API?

there is a helper coded: JRoute::_(ContentHelperRoute::getCategoryRoute($item->id, $item->language)) It does precisely what I want it to do, but I need the same functionality for the "Featured" View....
ranwilli's user avatar
1 vote
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
3 votes
2 answers
862 views

Unset not removing parameter from URL

I am writing a component with two views - a list view, and an article view. The list view generates the links for each article as follows, with $text being the variable I want in the URL. <?php ...
RichardB's user avatar
  • 3,082