After archive view gets a new filter, or I should say request variable https://github.com/joomla/joomla-cms/pull/5810/files#diff-d7a935efa065e279efc4bf2f15dd6288R13
build routing to archive is hard to design or unavailable.
Before such change archive view was without Key (simple display all archive articles).
Now it is with with multiple key available like index.php?option=com_content&view=archive&catid[0]=1&catid[0]=2...
this means only articles from such categories can be visible.
catid
single variable, only one category id allowedLabels |
Added:
?
|
i think #18179 is not related to this issue, this issue is about SEF url building
The SEF url building use a hash map to do a 1-step ( i mean O(1) performace) lookup for finding the appropriate menu item
e.g.
$Itemid = $this->lookup[$language][$view];
$Itemid = $this->lookup[$language][$view . $layout];
$Itemid = $this->lookup[$language][$view][(int) $id];
$Itemid = $this->lookup[$language][$view . $layout][(int) $id];
which exactly of the above is used depends on the view and the request variables that menu items of the view are using
before your PR i --guess-- (i have not looked at exact code) lookup was
$Itemid = $this->lookup[$language][$view. $layout];
if we use single value category filter we could use (something like)
$Itemid = $this->lookup[$language][$view. $layout][(int) $id];
where $id is category id
if we have multiple category filters then what are we going to use ?
My suggestion (if i have understood the issue well)
ignore archive menu items with multi-value category filter during menu item lookup (do not add them to the lookup table at all)
use archive menu items with single-value category filter by creating entry
$Itemid = $this->lookup[$language][$view . $layout][(int) $id];
$Itemid = $this->lookup[$language][$view . $layout][0];
and of course first check if archive menu item for specific category exists and use ot
and then if not exists try ...[0]
before your PR i --guess-- (i have not looked at exact code) lookup was
$Itemid = $this->lookup[$language][$view. $layout];
And now it's the same for build, but not for parsing SEF URL. it is inconsistency.
We would add:
$Itemid = $this->lookup[$language][$view. $layout][(int) $id];
by changing new routing and replace:
https://github.com/joomla/joomla-cms/blob/staging/components/com_content/router.php#L40
by:
$archive = new JComponentRouterViewconfiguration('archive');
$archive->setKey('catid');
$this->registerView($archive);
and then make catid as single-value category filter.
This is what I prefer.
The second way is designed in featured view for featured_categories
filter. Take a look at featured/default.xml
and compare with archive/default.xml
I want to solve routing for archive items and there is a one issue about routing, please take care about SEO.
How should looks like URL routing for archive articles?
The same URL for published and archive article:
/category-A/my-article
for both but archived articles are listed at /my-archives
and it won't not be listed at /category-A
.Or archived article should be moved to new URL:
/my-archives/category-A/my-artcile
and should not be access-able (404 or redirect) by /category-A/my-article
Category | ⇒ | Router / SEF |
Status | New | ⇒ | Discussion |
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-10-04 17:18:00 |
Closed_By | ⇒ | csthomas |
The option 1 is for now implemented in modern routing then this issue is not valid.
Another thing is that archived categories is not visible in Category filter. Is that correct behaviour?