joomla/joomla-cms — pull request #5533 by Hackwar (2014-12-27 23:38:28+00:00)
Title: Routing: No-Itemid- and Default-behavior for components

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
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