Questions tagged [router]
The router creates and interprets nice Search Engine Friendly URLs
47
questions
0
votes
1
answer
15
views
Why does my article have the wrong URL?
I have a really weird issue that I haven't seen before. Obviously I am blaming the client.
On this page: https://tekexpress.co.uk/news?start=12 all of the articles click through.
But the "7 ...
0
votes
1
answer
75
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 ...
1
vote
0
answers
62
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 ...
1
vote
0
answers
72
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 ....
0
votes
1
answer
229
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 ...
0
votes
1
answer
39
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...
...
0
votes
1
answer
307
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=...
0
votes
1
answer
122
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
...
0
votes
1
answer
117
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\...
0
votes
1
answer
53
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 ...
1
vote
1
answer
205
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 ...
1
vote
0
answers
40
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 ...
0
votes
0
answers
84
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 ...
2
votes
1
answer
727
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 ...
2
votes
1
answer
251
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....
0
votes
1
answer
326
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-...
0
votes
1
answer
947
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 ...
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¶meter=PARAM which ...
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 ...
1
vote
0
answers
211
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 ...
1
vote
0
answers
64
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 ...
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?
...
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 ...
2
votes
0
answers
681
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 ...
0
votes
1
answer
65
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 ...
1
vote
1
answer
142
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 ...
0
votes
1
answer
374
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?
0
votes
1
answer
204
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 ...
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 ...
0
votes
1
answer
84
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,...
0
votes
1
answer
86
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 ...
2
votes
2
answers
740
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 ...
0
votes
1
answer
1k
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 ...
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 ...
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.
...
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 ...
2
votes
1
answer
490
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=...
1
vote
2
answers
529
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'...
1
vote
1
answer
221
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 = $...
2
votes
1
answer
102
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 ...
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, ...
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 ...
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 ...
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 ...
0
votes
1
answer
191
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....
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 ...
3
votes
3
answers
875
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 ...