User tests: Successful: Unsuccessful:
This PR implements a rule for URLs with missing Itemid as a generic rule for all component routers that extend from JComponentRouterView.
class ContentRouter extends JComponentRouterBase
{
with
class ContentRouter extends JComponentRouterView
{
function __construct($app = null, $menu = null) {
$categories = new JComponentRouterViewconfiguration('categories');
$categories->setKey('id');
$this->registerView($categories);
$category = new JComponentRouterViewconfiguration('category');
$category->setKey('id')->setParent($categories, 'id')->setNestable()->addLayout('blog');
$this->registerView($category);
$article = new JComponentRouterViewconfiguration('article');
$article->setKey('id')->setParent($category, 'catid');
$this->registerView($article);
$this->registerView(new JComponentRouterViewconfiguration('archive'));
$this->registerView(new JComponentRouterViewconfiguration('featured'));
$this->registerView(new JComponentRouterViewconfiguration('form'));
parent::__construct($app, $menu);
$this->attachRule(new JComponentRouterRulesMenu($this));
$this->attachRule(new JComponentRouterRulesNomenu($this));
}
public function getCategorySegment($id, $query)
{
$category = JCategories::getInstance($this->getName())->get($id);
if ($category)
{
return array_reverse($category->getPath());
}
return array();
}
public function getCategoriesSegment($id, $query)
{
return $this->getCategorySegment($id, $query);
}
public function getArticleSegment($id, $query)
{
return array($id);
}
This was updated on May 22nd 2015. All discussions prior to that point have either been integrated or are obsolete.
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
Labels |
Added:
?
|
Category | ⇒ | Router / SEF |
Labels |
Added:
?
|
Is this still active? If so, I suggest a companion PR with patch for the listed code changes needed to implement the test conditions.
Please be aware that all comments above mine from May 23rd have either been incorporated into this or do not apply here. Those come from several cross merges.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-08-02 16:22:14 |
Closed_By | ⇒ | Hackwar |
I've updated this PR to work with the changed JComponentRouterView class. Please test.