Reference: #13633
@mbabker
It has not changed in 3.8-dev
Whether in monolanguage or multilingual, if we do not have a published menu item (hidden or not) of type Category or List all Categories, when we click on the articles links displayed through a Featured menu item (here as Home) we get urls of the type
index.php?view=article&id=1:article1
index.php?view=category&id=8
Testing conditions are the same as I posted above.
Therefore, if this cannot be changed, we have to modify the default multilingual installation to create Category Blogs as default Home instead of Featured menu items.
Note: if I choose a category blog as menu item to test with I have a Fatal error
`( ! ) Fatal error: Class 'Joomla\CMS\View\View' not found in .../libraries/src/Joomla/CMS/View/Category.php on line 19
Labels |
Added:
?
|
I'm just going to throw the comment here since it's essentially the same logic. If you use the archived articles view, you get the same issue.
With the existing router, it is possible to get SEF URLs when routing to archived content. The newer system isn't able to.
Current Router | New Router |
---|---|
/archived-articles/9-uncategorised |
/archived-articles?view=category&id=9 |
/archived-articles/9-uncategorised/67-whats-new-in-15 |
/archived-articles?view=article&id=67:whats-new-in-15 |
From a technical perspective, this is correct as the archived view is not part of the general view hierarchy (categories => category => article
). In the case of archived content though, it really feels like it should be able to *somehow*
be a parent view as archived is a content state (whereas featured isn't part of the state system but another setting).
Evidently, with that logic, if we set the Home page to a single article and display in the Details the link to the category (and still no menu item linking to this category or Categories), we get the same type of URL when clicking on the Category link.
index.php?view=category&id=8
When there is no menu item of type category or Categories, my expectation (and it seems also for many users) is to get something like
index.php/aliasofcategory
and in the case of the article link in my first post:
index.php/alieasofcategory/aliasofarticle
where aliasofcategory corresponds to category with id 8 and aliasofarticle article with id 1.
Is it possible to modify this new router to obtain that kind of url?
When there is no menu item of type category or Categories, my expectation (and it seems also for many users) is to get something like
index.php/aliasofcategory
Is it possible to modify this new router to obtain that kind of url?
Since the new router has a more "pluggable" based approach (ability to add custom rules to the processing), in theory someone could work on a plugin to add that type of logic. But I don't know right now if we could get that to a stable point before 3.8.
If we were to start generating URLs like index.php/aliasofcategory
by default instead of either non-SEF URLs or our current index.php/component/content/category/8-aliasofcategory
paths, the router would then at least have to start querying the categories table to figure out how to handle routing if it can't do the routing based on the menu system, then we get into an issue of ensuring that the root categories are unique (how do you handle index.php/uncategorised
as an example when each component in core has that category).
I do think it's a "fun" issue to work through, but it's going to take some time to get that right.
Would it be sensible to at least check if there is a suitable menu item to use and, if not, degrade to legacy URLs?
Note: will see (if it easy) how to modify anyway the default multilingual install. ;)
There's another issue open for that degrade thinking. So it's also being
thought about and discussed.
On Sun, Jun 4, 2017 at 12:16 PM infograf768 notifications@github.com
wrote:
Would it be sensible to at least check if there is a suitable menu item to
use and, if not, degrade to legacy URLs?Note: will see (if it easy) how to modify anyway the default multilingual
install. ;)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#16496 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWfoT1Qtj20D-fpfMkcf4WujlbMB4Kfks5sAoQIgaJpZM4NvTHj
.
--
Category | ⇒ | Router / SEF |
Status | New | ⇒ | Discussion |
I can confirm the problem with the orphan article.
Would it be sensible to at least check if there is a suitable menu item to use and, if not, degrade to legacy URLs?
it is a good idea, if it is possible.
My simple test to confirm the problem:
Joomla 3.8.0dev, no sample data
Create a new article, title: orphan01 --> in the Category: Uncategorised
Create a new Category, title: blog
Create a new article, title: article01 --> in the Category: blog
in the "article01" text use the "Article" editor button to insert a link to orphan01
Create a new item menu "Category Blog", Choose a Category --> blog and title: Menu Category Blog
see in frontend from the category blog menu:
index.php/menu-category-blog/2-article01
and the link inside article01 to orphan01:
index.php/menu-category-blog/2-uncategorised/1-orphan01 Status ok
rename .htaccess
enabled "Use URL Rewriting"
enabled "Adds Suffix to URL"
see in frontend from the category blog menu:
menu-category-blog/2-article01.html
and the link inside article01 to orphan01:
menu-category-blog/2-uncategorised/1-orphan01.html Status ok
enabled URL Routing "Experimental"
enabled Remove IDs from URLs "Yes"
menu-category-blog/article01.html
and the link inside article01 to orphan01:
menu-category-blog/orphan01.html Status Error 404 URL invalid
To sum all things up - new router does NOT work on multilanguage sites, archives, featured and orphan articles? Am I understanding it correctly? Is it flagged as "broken" or is it intentional behavior?
Still does not work we get ?view=article&id=99:
@DanielRuf can you please test #17746?
@franz-wohlkoenig is there a way to patch core files without directly modifying them?
Also I still do not understand why the routing component is done so overcomplicated. Check if slug exists in database / structure or remove ID is set => remove ID and use slug. Otherwise use ID.
So far other CMS have not such issues and some also use symfony/routing
.
Just my personal opinion about this neverending routing story. (I know that Joomla tries to reinvent the wheel in some areas for example regarding the cryptography. Don't do this and reuse established composer packages ;-) ).
@DanielRuf easiest way https://docs.joomla.org/Testing_Joomla!_patches, you can also generate .patch file .
@franz-wohlkoenig I'm also not 100% sure about the answer, but @DanielRuf always can ask additional questions :)
*without.
So both solutions do the same? I would prefer patch using SSH, or is the Patch Tester the recommended and better way?
Personally I would recommend https://github.com/cweagans/composer-patches, can we add this to Joomla core in master?
That wont help you at all
@DanielRuf Do a separate Joomla! installation from staging branch of this repository then you can apply .patch or.diff from ssh and test :)
That wont help you at all
What exactly do you mean?
@DanielRuf Do a separate Joomla! installation from staging branch of this repository then you can apply .patch or.diff from ssh and test :)
This is our current approach but I would welcome something like composer-patches. Well, then we have to manually apply, test and remove the patch / diff.
@DanielRuf You can:
Current Router New Router /archived-articles/9-uncategorised /archived-articles?view=category&id=9 /archived-articles/9-uncategorised/67-whats-new-in-15 /archived-articles?view=article&id=67:whats-new-in-15
Article should not change URL when is moved from published state to archive state.
Article should always exists at /component/content/9-uncategorised/67-whats-new-in-15 or equivalent with itemid like /uncategorised/67-whats-new-in-15
After archive, the article disappears from category view (listing) and appears on archive view, URL is not changed.
There are some issues with the new URL routing, but it is difficult to find someone who will test PRs about URL routing.
If someone has a little time I suggest to test #18429, which is part of older, more complex #17746
I would like to write more code to improve the new URL routing but usual I have to wait until previous PR will be merged.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-01-05 23:21:28 |
Closed_By | ⇒ | brianteeman |
Based on the way the new system is set up, I believe we will need to change the multilingual installation. A featured item view isn't part of the content hierarchy so it can't logically be a parent view to an article or category.
Fixed via 3eda09e