?
avatar csthomas
csthomas
2 Oct 2017

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.

Possibility solutions

  • Remove catid filter from request variables, similar to featured view
  • Make catid single variable, only one category id allowed
avatar csthomas csthomas - open - 2 Oct 2017
avatar joomla-cms-bot joomla-cms-bot - change - 2 Oct 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Oct 2017
avatar csthomas
csthomas - comment - 2 Oct 2017

Another thing is that archived categories is not visible in Category filter. Is that correct behaviour?

avatar alikon
alikon - comment - 2 Oct 2017

things became "weird" after #17668 merge
a discussion is going at #18179

avatar ggppdk
ggppdk - comment - 2 Oct 2017

@alikon

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 ?

avatar ggppdk
ggppdk - comment - 2 Oct 2017

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

  • use archive menu items with none selected category filter by creating entry

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

avatar csthomas
csthomas - comment - 2 Oct 2017

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

avatar csthomas
csthomas - comment - 2 Oct 2017

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?

  1. The same URL for published and archive article:

    • like /category-A/my-article for both but archived articles are listed at /my-archives and it won't not be listed at /category-A.
  2. 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

avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Oct 2017
Category Router / SEF
avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Oct 2017
Status New Discussion
avatar csthomas csthomas - change - 4 Oct 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-10-04 17:18:00
Closed_By csthomas
avatar csthomas csthomas - close - 4 Oct 2017
avatar csthomas
csthomas - comment - 4 Oct 2017

The option 1 is for now implemented in modern routing then this issue is not valid.

Add a Comment

Login with GitHub to post a comment