User tests: Successful: Unsuccessful:
Problem: on a multilingual site, when displaying the info-block for articles in frontend , the urls of the category and parent category are real bad.
ContentHelperRoute::getCategoryRoute()
should ALWAYS contain the $language
variable.
This PR adds it wherever necessary, including in layouts/joomla/content/info-block/
corresponding files. Queries are modified to also select the category language. The language is also added in data.
com_content/helpers/route.php
should cope with categories set to ALL languages
The code is modified to take this into account as, in this case, the language to use in the url should be the language of the UI content language.
com_content/helpers/route.php
should not add for example &layout=cassiopeamyblog
to the end of the sef url when such a specific html/com_content/category/myblog.etc
menu item type is present in the template.
To solve this, I had to revert #19681
Install a multilingual site with 2 content languages.
Tests can be done on a single language. Choose en-GB for example as it is easier.
Create some categories and articles in these categories both tagged to the same language [CATen-GB, CATfr-FR].
Create a home blog menu item for each content language to display one CATen-GB and one CATfr-FR
Make sure you create a (hidden or not) List All Categories
menu item tagged to en-GB in mainmenu en-GB.
=> This is important as any category which has no specific menu item will still get a nice sef url.
Create also a Category set to ALL language and a child category of that category (tagged to ALL or to en-GB). Add to the child category an article tagged to en-GB ("Articletest").
Create a single menu item in mainmenu en-GB to display the "articletest" article.
Now, the second part of the test concerns the revert of the layout code in route.php.
To test this, it is necessary to add a new menu item type.
Find here a .zip of the files to add in /templates/cassiopeia/html/com_content/category/
myblog.zip
Create a menu item using this type in mainmenu en-GB to display any category not yet displayed by the former menu items.
In Articles Options, make sure show category and link as well as show Parent category and link are set to yes.
Make sure all your menu items use these global settings
When clicking on the Category or Parent category links you should get nice urls
not containing some stuff like
?view=category&id=18
or
&layout=cassiopeamyblog
when using the custom menu item type
Instead one may get for example when no menu item for the category
/en/allcategories-en-gb/category-all
(here set to ALL)
or
/en/allcategories-en-gb/category-all/othercaten-gb
(category set to en-GB)
and same for the custom menu item type (myblog menu item type)
Reverting #19681 is necessary.
We should look for another way to implement this feature.
The modifications concerning getCategoryRoute() and route.php should also be done for other components using this method.
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_content Layout |
Labels |
Added:
?
|
Category | Front End com_content Layout | ⇒ | Front End com_content Layout Libraries |
after some further tests, i think my changes in menurules are not enough.
restarted drone as non-related error
The code is OK. I wonder if this issue occurs on J3?
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-09-06 05:56:22 |
Closed_By | ⇒ | laoneo | |
Labels |
Added:
?
|
Thanks
On it for most parts except the fingerprint of the method