How to use the new View Based Router Classes

500 views
Skip to first unread message

Dave

unread,
Aug 8, 2016, 4:34:39 AM8/8/16
to Joomla! General Development
Hi, I have created a number of components with routers. Most of these routers are view based.

I was wondering if someone could explain or direct me to some kind of documentation/tutorial about how the new view based router classes (such as JComponentRouterView, JComponentRouterViewconfiguration, etc) are used and if there are any conventions I should follow (class names, filenames, file locations, etc).

Hannes Papenberg

unread,
Aug 10, 2016, 8:09:00 AM8/10/16
to joomla-de...@googlegroups.com
Hi Dave,
I'll try to describe this the best I can. This file is a good example:
https://github.com/Hackwar/joomla-cms/blob/6159beb327d5d4a3b9695680bcc0fa8ec4b77849/components/com_content/router.php

1. Create a file named router.php in the frontend root of your
component. In that file create a class named <componentname without
com_-prefix>Router, for example ContentRouter for com_content, that
extends from JComponentRouterView.

2. In that class, provide a constructor that takes the application
object and the menu object to work with.

3. In the constructor, define the views that you have. For this you
create a JComponentRouterViewConfiguration object (further along named
$view) with the name of the view. Example: $view = new
JComponentRouterViewconfiguration('featured'); If your view is a
standalone view with no URL identifier, etc. like the article edit view
('form') of com_content or the featured view of com_content, your view
is already completely defined and you can register it in your router
with $this->registerView().

4. If your view takes a URL identifier, like the &id= parameter of the
article view of com_content, you have to set the name of that identifier
variable in your $view object with $view->setKey(). This could be 'id'
or 'user' or whatever your component uses.

5. If your view also has a parent view, like an article view which can
be reached via a category view, you then have to define the parent view
of $view. You take the child view and then call $view->setParent($view2,
'parentidentifier') where $view2 is the configuration object of the
parent view and 'parentidentifier' is the identifier that is used. For
example an URL to an article has the identifier catid for the category
ID in com_content, where in a URL to a category, the identifier is
simply 'id'.

6. If your view can also link to itself in terms of its hierarchy, you
can then also call $view->setNestable() to mark the view accordingly. A
nestable view is for example the category view. A category view can list
articles, but it can also list child-categories that again link to a
category view.

7. Last and currently not used: You can define additional layouts that
your component provides, like 'blog', 'faq' or similar. This might be
used in the future.

8. Now that all your views have been registered with the router in the
above described manner, we have to call the parent constructor with the
application and menu object that we've been given. Now our router has
been given the necessary information.

9. After the parent constructor has been called, we can then add the
behavioral logic by adding rules to the router. These rules act on the
view definitions that we added above. You simply call
$this->attachRule() with a rule object. A rule object always gets the
router as parameter for its constructor. Rules have to implement the
JComponentRouterRulesInterface interface and can be added or removed at
will, for example in a plugin. (You can also add additional views via a
plugin.) JComponentRouterRulesMenu implements the Itemid lookup for your
router, JComponentRouterRulesStandard implements the current behavior of
the Joomla core components, JComponentRouterRulesNomenu implements the
behavior when no Itemid is present after the Itemid lookup.

10. If your component uses views with identifiers, you then have to
define some lookup methods for those views. For creating the URLs, you
have to create a get<ViewName>Segment method that takes an ID and the
current query and returns an associative array of strings that
could/should be part of the URL. The keys of that array are the IDs of
each segment and the string represents the URL segment. For a
non-nestable view like the articles view of com_content, that would
simply be array(42 => '42:guide-to-the-galaxy'), while for a nestable
view it is the path from the given ID to the root of the content
entities that you are using. So for a category view it would return the
path of all categories from the one that you want to link to down to the
root of the category tree. Example: array(23 => '23:towel', 22 =>
'22:never-leave-the-house-without', 21 =>
'21:content-of-the-guide-to-the-galaxy') The string can be whatever you
like, as long as you can later convert back from that string to an
identifier, so you can leave the ID out of that string, because you
lastly have to define a get<Viewname>Id method that takes the segment
and the query that has been parsed so far and returns an identifier for
that segment. It is up to you how you look that up. See the example at
the top how the core does it.

With these 10 easy steps, your router is done. ;-)

I hope that helps.

Regards,
Hannes

JoeforJoomla Boy

unread,
Aug 10, 2016, 8:32:20 AM8/10/16
to Joomla! General Development
Mmm this sounds really complex... at first look more complex than the current router for components.
Also i'm not confident that it will work in a stable way.

Hannes Papenberg

unread,
Aug 10, 2016, 9:02:47 AM8/10/16
to joomla-de...@googlegroups.com
Feel free to describe a universal component router in less words.
Considering complexity of the code: The new router for com_content has
216 lines compared to 477 + 234 lines (router and ContentHelperRoute),
is able to "remove" the IDs from the URLs und provides the same URLs
everywhere, regardless of you using ContentHelperRoute or not.

Hannes
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-gene...@googlegroups.com>.
> To post to this group, send email to joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/joomla-dev-general.
> For more options, visit https://groups.google.com/d/optout.

Allon Moritz

unread,
Aug 10, 2016, 10:39:03 AM8/10/16
to joomla-de...@googlegroups.com
@Hannes I tried to test the 3.7 branch, but I was not able to remove the id's in the url event tough I have set use new router in the content config to yes. What else do I need to change?

On Wed, Aug 10, 2016 at 3:02 PM, 'Hannes Papenberg' via Joomla! General Development <joomla-de...@googlegroups.com> wrote:
Feel free to describe a universal component router in less words. Considering complexity of the code: The new router for com_content has 216 lines compared to 477 + 234 lines (router and ContentHelperRoute), is able to "remove" the IDs from the URLs und provides the same URLs everywhere, regardless of you using ContentHelperRoute or not.

Hannes

Am 10.08.2016 um 14:32 schrieb JoeforJoomla Boy:
Mmm this sounds really complex... at first look more complex than the
current router for components.
Also i'm not confident that it will work in a stable way.


On Monday, August 8, 2016 at 10:34:39 AM UTC+2, Dave wrote:

    Hi, I have created a number of components with routers. Most of
    these routers are view based.

    I was wondering if someone could explain or direct me to some kind
    of documentation/tutorial about how the new view based router
    classes (such as JComponentRouterView,
    JComponentRouterViewconfiguration, etc) are used and if there are
    any conventions I should follow (class names, filenames, file
    locations, etc).

--
You received this message because you are subscribed to the Google
Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsubscribe@googlegroups.com.
To post to this group, send an email to joomla-dev-general@googlegroups.com.

Hannes Papenberg

unread,
Aug 10, 2016, 10:54:15 AM8/10/16
to joomla-de...@googlegroups.com
There is an additional switch to switch between ID- and non-ID-URLs. The
new routing is NOT there to remove the IDs. Its goal is to finally get
code that is worthy for this decade. (The original routing code is
basically from 2005.) With the new routing enabled, we can then easily
add additional features, in this case removing the IDs. So that is an
additional option.

Am 10.08.2016 um 16:38 schrieb Allon Moritz:
> @Hannes I tried to test the 3.7 branch, but I was not able to remove the
> id's in the url event tough I have set use new router in the content
> config to yes. What else do I need to change?
>
> On Wed, Aug 10, 2016 at 3:02 PM, 'Hannes Papenberg' via Joomla! General
> Development <joomla-de...@googlegroups.com
> an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>
> <mailto:joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>>.
> To post to this group, send email to
> joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>
> <mailto:joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>>.
> <https://groups.google.com/group/joomla-dev-general>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>.
> To post to this group, send an email to
> joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>.
> <https://groups.google.com/group/joomla-dev-general>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-gene...@googlegroups.com>.
> To post to this group, send email to joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>.

Allon Moritz

unread,
Aug 11, 2016, 2:15:18 AM8/11/16
to joomla-de...@googlegroups.com
But then the new setting doesn't make sense in the Article manager configuration, nobody does understand that if something can be turned on but nothing changes. Would it be hard to switch to none id urls then for articles?

On Wed, Aug 10, 2016 at 4:54 PM, 'Hannes Papenberg' via Joomla! General Development <joomla-de...@googlegroups.com> wrote:
There is an additional switch to switch between ID- and non-ID-URLs. The new routing is NOT there to remove the IDs. Its goal is to finally get code that is worthy for this decade. (The original routing code is basically from 2005.) With the new routing enabled, we can then easily add additional features, in this case removing the IDs. So that is an additional option.

Am 10.08.2016 um 16:38 schrieb Allon Moritz:
@Hannes I tried to test the 3.7 branch, but I was not able to remove the
id's in the url event tough I have set use new router in the content
config to yes. What else do I need to change?

On Wed, Aug 10, 2016 at 3:02 PM, 'Hannes Papenberg' via Joomla! General

        To post to this group, send email to

        Visit this group at
        https://groups.google.com/group/joomla-dev-general
        <https://groups.google.com/group/joomla-dev-general>.
        For more options, visit https://groups.google.com/d/optout
        <https://groups.google.com/d/optout>.


    --
    You received this message because you are subscribed to the Google
    Groups "Joomla! General Development" group.
    To unsubscribe from this group and stop receiving emails from it,

    To post to this group, send an email to

--
You received this message because you are subscribed to the Google
Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsubscribe@googlegroups.com.
To post to this group, send an email to joomla-dev-general@googlegroups.com.

Hannes Papenberg

unread,
Aug 11, 2016, 10:29:21 AM8/11/16
to joomla-de...@googlegroups.com
The new routing is a component specific setting and not a global one.
You can write your component to use the new routing or not and you can
write your component router to switch between different routing methods.
At the same time, the new routing is not 100% backwards compatible and
will return different URLs for articles which path have more than one
category between the article and the menu item. That is why you can
decide to use the old or new routing, in order to be backwards
compatible and to keep your search engine results.

If you are unhappy with that, either get Joomla 4.0 on the way or bring
up a new discussion about backwards compatibility.

To be honest, after fighting for this change for 7 years now (I first
proposed this this month 7 years ago. Hooray, lets celebrate!) and it
still not being fully accepted, I'm this close to simply giving up.

Am 11.08.2016 um 08:14 schrieb Allon Moritz:
> But then the new setting doesn't make sense in the Article manager
> configuration, nobody does understand that if something can be turned on
> but nothing changes. Would it be hard to switch to none id urls then for
> articles?
>
> On Wed, Aug 10, 2016 at 4:54 PM, 'Hannes Papenberg' via Joomla! General
> Development <joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>> wrote:
>
> There is an additional switch to switch between ID- and non-ID-URLs.
> The new routing is NOT there to remove the IDs. Its goal is to
> finally get code that is worthy for this decade. (The original
> routing code is basically from 2005.) With the new routing enabled,
> we can then easily add additional features, in this case removing
> the IDs. So that is an additional option.
>
> Am 10.08.2016 um 16:38 schrieb Allon Moritz:
>
> @Hannes I tried to test the 3.7 branch, but I was not able to
> remove the
> id's in the url event tough I have set use new router in the content
> config to yes. What else do I need to change?
>
> On Wed, Aug 10, 2016 at 3:02 PM, 'Hannes Papenberg' via Joomla!
> General
> Development <joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>
> <mailto:joomla-de...@googlegroups.com
> joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>
>
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com
> <mailto:joomla-dev-general%252Buns...@googlegroups.com>>
> <mailto:joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>
>
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com
> <mailto:joomla-dev-general%252Buns...@googlegroups.com>>>.
> To post to this group, send email to
> <mailto:joomla-de...@googlegroups.com>>>.
> Visit this group at
> https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>
> <https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>>.
> For more options, visit
> https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
>
>
> --
> You received this message because you are subscribed to the
> Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails
> from it,
> send an email to
> joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com
> <mailto:joomla-dev-general%252Buns...@googlegroups.com>>.
> To post to this group, send an email to
> <mailto:joomla-de...@googlegroups.com>>.
>
> Visit this group at
> https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>
> <https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from
> it, send
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>>.
> To post to this group, send email to
> <mailto:joomla-de...@googlegroups.com>>.
> Visit this group at
> https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>.
> To post to this group, send an email to
> joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>.
> Visit this group at
> https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-gene...@googlegroups.com>.
> To post to this group, send email to joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>.

JoeforJoomla Boy

unread,
Aug 11, 2016, 1:22:24 PM8/11/16
to Joomla! General Development
Well the fact of having 2 routing methods and the new one that is far more complex and less powerful than the old one is indeed not a big deal. Maybe this is the main reason that blocked it for so many  years. Personally i found the current Joomla router method the best as possible, it's so much flexible and don't limit to views but even to task and other parameters. I even wasn't aware that it's not backward compatible, if you say me that existing URLs change, i say you that this is really not acceptable. A lot of websites would lose SEO ranking. Personally i would like to open a new discussion to give it up.


On Monday, August 8, 2016 at 10:34:39 AM UTC+2, Dave wrote:

Hannes Papenberg

unread,
Aug 11, 2016, 4:10:56 PM8/11/16
to joomla-de...@googlegroups.com
Sorry, but that comment shows that you have less than zero idea about
what you are talking about.

The new routing is not forced on you, neither as a developer, nor as a
user. If you don't want to use it: Don't. If you insist on using
spaghetti code in your function based router, have fun. If you think
your component is special and can not be pressed into such a "confining"
idea like only SEFing view based URLs, don't let me stop you hanging
yourself with your special code. But for the 98% of the other,
boilerplate components out there, writing a router with this code now is
a matter of minutes instead of hours or even days.

I can't even start to express how much your comment insults me, since
you obviously didn't even read the mail that you responded to. You are
simply displaying knee-jerk responses here. No, the new routing is NOT
backwards incompatible. Yes, it is an improvement. No, this is not open
for discussion. Or let me restate that last comment: If you open that up
for discussion, based on a comment from someone who quite obviously is
completely clueless and didn't even look at one line of code from this
project, I'm going to happily fork Joomla.

Hannes Papenberg
11 year Joomla contributor

Dave

unread,
Aug 12, 2016, 2:11:32 AM8/12/16
to Joomla! General Development
Thanks Hannes, while I had read over your post a couple times it's a big step forward in understanding how it all works.

Joomla convention is to put controllers in the "controllers" folder, models in the "models" folder and the views in the "views" folder - is there a convention for where the rules should be kept  - "com_mycomponent/rules" or "com_mycomponent/router/rules" or something ?

Regards
Dave

Hannes Papenberg

unread,
Aug 12, 2016, 2:24:18 AM8/12/16
to Joomla! General Development

No, there is no convention for that. The expectation is that you don't really need component specific rules. But in any case, they are normally autoloaded from the libraries folder. If you have custom rules, you can simply require_once the file.

Hannes


--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send email to joomla-dev-general@googlegroups.com.

Dave

unread,
Aug 12, 2016, 4:39:47 AM8/12/16
to Joomla! General Development
I encourage you not to give up on this one, I am sure there are many extension developers like myself who find implementing the router to be one of the most awkward/problematic parts of creating a component.

Regards,
Dave
>             To post to this group, send an email to
>             joomla-de...@googlegroups.com
>         <mailto:joomla-de...@googlegroups.com>
>             <mailto:joomla-de...@googlegroups.com
>         <mailto:joomla-de...@googlegroups.com>>.
>
>             Visit this group at
>             https://groups.google.com/group/joomla-dev-general
>         <https://groups.google.com/group/joomla-dev-general>
>             <https://groups.google.com/group/joomla-dev-general
>         <https://groups.google.com/group/joomla-dev-general>>.
>             For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>
>             <https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>>.
>
>
>         --
>         You received this message because you are subscribed to the Google
>         Groups "Joomla! General Development" group.
>         To unsubscribe from this group and stop receiving emails from
>         it, send
>         <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>>.
>         To post to this group, send email to
>         joomla-de...@googlegroups.com
>         <mailto:joomla-de...@googlegroups.com>
>         <mailto:joomla-de...@googlegroups.com
>         <mailto:joomla-de...@googlegroups.com>>.
>         Visit this group at
>         https://groups.google.com/group/joomla-dev-general
>         <https://groups.google.com/group/joomla-dev-general>.
>         For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>
>     --
>     You received this message because you are subscribed to the Google
>     Groups "Joomla! General Development" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>.
>     To post to this group, send an email to
>     joomla-de...@googlegroups.com
>     <mailto:joomla-de...@googlegroups.com>.
>     Visit this group at
>     https://groups.google.com/group/joomla-dev-general
>     <https://groups.google.com/group/joomla-dev-general>.
>     For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send

Allon Moritz

unread,
Aug 18, 2016, 4:51:59 AM8/18/16
to joomla-de...@googlegroups.com
I'm also convinced that this is the way to go. But my comment about the misleading setting in the Article manager was just feedback no attack. I was even a packer of your campaign (and waiting to get it implemented on my component). If it would be possible to implement ID less urls for articles, then I would do it. It should then showcase how it has to be done for other extensions as well. Per default it can be turned off. For me it is confusing to have a setting which doesn't do anything visually. What needs to be done to have articles without ID in the url?

>             To post to this group, send an email to
>             joomla-de...@googlegroups.com
>         <mailto:joomla-de...@googlegroups.com>
>             <mailto:joomla-de...@googlegroups.com
>         <mailto:joomla-de...@googlegroups.com>>.
>
>             Visit this group at
>             https://groups.google.com/group/joomla-dev-general
>         <https://groups.google.com/group/joomla-dev-general>
>             <https://groups.google.com/group/joomla-dev-general
>         <https://groups.google.com/group/joomla-dev-general>>.
>             For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>
>             <https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>>.
>
>
>         --
>         You received this message because you are subscribed to the Google
>         Groups "Joomla! General Development" group.
>         To unsubscribe from this group and stop receiving emails from
>         it, send
>         To post to this group, send email to
>         joomla-de...@googlegroups.com
>         <mailto:joomla-de...@googlegroups.com>
>         <mailto:joomla-de...@googlegroups.com
>         <mailto:joomla-de...@googlegroups.com>>.
>         Visit this group at
>         https://groups.google.com/group/joomla-dev-general
>         <https://groups.google.com/group/joomla-dev-general>.
>         For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>
>     --
>     You received this message because you are subscribed to the Google
>     Groups "Joomla! General Development" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     To post to this group, send an email to
>     Visit this group at
>     https://groups.google.com/group/joomla-dev-general
>     <https://groups.google.com/group/joomla-dev-general>.
>     For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> To post to this group, send email to joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/joomla-dev-general.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send email to joomla-dev-general@googlegroups.com.

Hannes Papenberg

unread,
Aug 18, 2016, 5:19:24 AM8/18/16
to joomla-de...@googlegroups.com
Set the settings to "Use new URL routing" and set the setting to "Remove
IDs from URLs" both to yes.

Hannes

Am 18.08.2016 um 10:51 schrieb Allon Moritz:
> I'm also convinced that this is the way to go. But my comment about the
> misleading setting in the Article manager was just feedback no attack. I
> was even a packer of your campaign (and waiting to get it implemented on
> my component). If it would be possible to implement ID less urls for
> articles, then I would do it. It should then showcase how it has to be
> done for other extensions as well. Per default it can be turned off. For
> me it is confusing to have a setting which doesn't do anything visually.
> What needs to be done to have articles without ID in the url?
>
> On Fri, Aug 12, 2016 at 10:39 AM, 'Dave' via Joomla! General Development
> <joomla-de...@googlegroups.com
> > joomla-dev-gene...@googlegroups.com
> >
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>
> >
> > <mailto:joomla-dev-general%2Bunsu...@googlegroups.com
> >
> <mailto:joomla-dev-general%252Buns...@googlegroups.com>>
> >
> <mailto:joomla-dev-gene...@googlegroups.com
> >
> <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>
> >
> > <mailto:joomla-dev-general%2Bunsu...@googlegroups.com
> >
> <mailto:joomla-dev-general%252Buns...@googlegroups.com>>>.
> > joomla-dev-gene...@googlegroups.com
> > <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>
> > <mailto:joomla-dev-general%2Bunsu...@googlegroups.com
> > <mailto:joomla-dev-general%252Buns...@googlegroups.com>>.
> > <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>>.
> > <https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> > <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Joomla! General Development" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to joomla-dev-gene...@googlegroups.com
> > <mailto:joomla-dev-general%2Bunsu...@googlegroups.com>.
> > <https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> > <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Joomla! General Development" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to joomla-dev-gene...@googlegroups.com
> > <mailto:joomla-dev-gene...@googlegroups.com>.
> > To post to this group, send email to
> joomla-de...@googlegroups.com
> > <mailto:joomla-de...@googlegroups.com>.
> > Visit this group at https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-gene...@googlegroups.com>.
> To post to this group, send email to
> joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>.
>
> Visit this group at
> https://groups.google.com/group/joomla-dev-general
> <https://groups.google.com/group/joomla-dev-general>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-gene...@googlegroups.com>.

Francesco Reitano

unread,
May 28, 2020, 6:44:01 AM5/28/20
to Joomla! General Development
Hi, i try to use this code:
https://codeshare.io/2EEmMO
but the url from:
JRoute::_('index.php?option=com_courses&view=course&category=5:area-fiscalita&id=3:corso-oro-fiscalita-passato')
get
http://mysite.com/corsi?view=course&category=5:area-fiscalita&id=3:corso-oro-fiscalita-passato

the result must be:
corsi/nameOfCategory/nameOfCourse
so
corsi/area-fiscalita/corso-oro-fiscalita-passato
"corsi" is the item name in menu

why it does not work?
can you hel me?

thanks
Reply all
Reply to author
Forward
0 new messages