? No Code Attached Yet
avatar Scrabble96
Scrabble96
6 Jul 2022

What needs to be fixed

I see a notification in the control panel for a changed bit of code in /components/com_content/tmpl/article/default.php on line 37 from this:
<div class="com-content-article item-page <?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Article">
to this:
<div class="com-content-article item-page<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Article">

Why this should be fixed

When adding a class in a Category Blog menu item, in the 'Page Display' tab under 'Page Class' this is now flush with item-page e.g.
class="com-content-article item-pagemy-class instead of
class="com-content-article item-page my-class

This seems to have reverted to how it was in J3 when you had to add a space before the custom class.

How would you fix it

Put the space back in

Side Effects expected

None

avatar Scrabble96 Scrabble96 - open - 6 Jul 2022
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jul 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Jul 2022
avatar Scrabble96 Scrabble96 - change - 6 Jul 2022
The description was changed
avatar Scrabble96 Scrabble96 - edited - 6 Jul 2022
avatar Scrabble96 Scrabble96 - change - 6 Jul 2022
The description was changed
avatar Scrabble96 Scrabble96 - edited - 6 Jul 2022
avatar brianteeman
brianteeman - comment - 6 Jul 2022

The last time that line was changed was 4 years ago. There wasnt a space then either.

avatar Scrabble96
Scrabble96 - comment - 7 Jul 2022

There should be a space. If you add a class to a single article menu item in 'Page Display > Page Class' it is displayed with a preceding space.
If you add a class to a category blog menu item it is displayed with a preceding space.
Ditto menu item type 'Smart Search' and so on.

Originally in J3 any page class added in the control page had to have a preceding space.
AFAIK, it was intended that in J4 this would no longer be necessary as the space would be included in the core code.
Perhaps this one just got missed?

avatar chmst
chmst - comment - 7 Jul 2022

I also think that this was forgotten. Please test #38242

avatar chmst chmst - change - 7 Jul 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-07-07 09:52:07
Closed_By chmst
avatar chmst chmst - close - 7 Jul 2022
avatar chmst chmst - change - 7 Jul 2022
Status Closed New
Closed_Date 2022-07-07 09:52:07
Closed_By chmst
avatar chmst chmst - reopen - 7 Jul 2022
avatar richard67
richard67 - comment - 9 Jul 2022

Just my 5 cent: if it is appended without a space by the PHP code it should be called “… class suffix” in the admin ui, and if it is added with a separating space it should be called “class” in the admin ui, so that it’s clear what it is. The misleading variable names “…_sfx” are something else, they might be kept as they are.

avatar richard67
richard67 - comment - 9 Jul 2022

So here in this case the label “Page Class” is wrong, it should be “Page Class.Suffix” as long as the code works like now.

avatar chmst chmst - change - 20 Jul 2022
Labels Added: ?
avatar chmst chmst - labeled - 20 Jul 2022
avatar chmst
chmst - comment - 20 Jul 2022

Labelled this as a new feature, as we cannot make changes here without b/c breaks.

Add a Comment

Login with GitHub to post a comment