? Failure

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
27 Dec 2014

NOTICE

This has been superseded by #5599 and #5604.


This PR implements a rule for URLs with missing Itemid and the default behavior of components as generic rules for all component routers that extend from JComponentRouterAdvanced.

How to test

  • Apply this change
  • Change the router of com_content by replacing the router of com_content with the following code:
<?php
class ContentRouter extends JComponentRouterAdvanced
{
    public function __construct($app = null, $menu = null) {

        $this->registerView('categories', 'categories');
        $this->registerView('category', 'category', 'id', 'categories', '', true, array('default', 'blog'));
        $this->registerView('article', 'article', 'id', 'category', 'catid');
        $this->registerView('archive', 'archive');
        $this->registerView('featured', 'featured');
        $this->registerView('form', 'form');
        parent::__construct($app, $menu);

        $this->attachRule(new JComponentRouterRulesMenu($this));
        $this->attachRule(new JComponentRouterRulesNomenu($this));
        $this->attachRule(new JComponentRouterRulesDefault($this));
    }
}
  • Comment line 69 and 123 from /components/com_content/helpers/route.php to disable the lookup of the Itemid there.
  • See that it creates sane URLs and that those URLs point to the right place.

Issues

This requires that #5446 and all depending requests are merged first. (You can still test this PR, since all changes from those PRs are included into this one.
IMPORTANT: This code is NOT ready yet. This is a first commit to provide people with a glimpse where the whole thing is going and to give other developers a chance to join in on the fun. :smile:

This was made possible through the generous donation of the people mentioned in the following link via an Indiegogo campaign: http://joomlager.de/crowdfunding/5-contributors

avatar Hackwar Hackwar - open - 27 Dec 2014
avatar jissues-bot jissues-bot - change - 27 Dec 2014
Labels Added: ?
avatar Hackwar
Hackwar - comment - 27 Dec 2014

@wilsonge, @johanjanssens, @weeblr-dev, @ercanozkaya, @Bakual, @smz, @mbabker Just trying to make you aware of this PR. This still needs quite a lot of improvement. Also, I would add a rule next that removes the ID from the URL. But that will have to wait a bit longer.

avatar smz
smz - comment - 27 Dec 2014

Thanks, well done: missed it!

avatar smz
smz - comment - 27 Dec 2014

Hannes, why don't you open an issue titled "Advancement in the Joomla router" (or something like that...)?

In the description you could list all router related PRs, their title, and their status (proposed/merged/closed) and post a message whenever a new PR is available.

No discussion should happens there (that should be reserved to the specific PRs), but whomever interested could subscribe for notification to that issue and be informed when "something news" happens...

avatar zero-24 zero-24 - change - 28 Dec 2014
Category Router / SEF
avatar Bakual
Bakual - comment - 28 Dec 2014

We don't need an issue with a list of PRs. We could add a category in JIssues to group them together if needed.

avatar zero-24
zero-24 - comment - 28 Dec 2014

We could add a category in JIssues to group them together if needed.

IIRC we can use Router / SEF see: http://issues.joomla.org/tracker/joomla-cms/?category=sef and at this view you can search for the creator hackwar (permalink don't work any how)

avatar Hackwar Hackwar - close - 3 Jan 2015
avatar Hackwar Hackwar - close - 3 Jan 2015
avatar Hackwar Hackwar - change - 3 Jan 2015
The description was changed
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-01-03 17:25:28
avatar Hackwar Hackwar - head_ref_deleted - 6 Jan 2016

Add a Comment

Login with GitHub to post a comment