In the admin area, go to any components default view by clicking on it's primary link:
When you load the components default view the following classes are incomplete in the <body>
tag declaration, you get instead:
and as you can see the names of the view and layout are missing part of the class declaration which means you cannot do 'page / view / layout' specific CSS styling when it is loaded as a default view.
If you load https://localhost/platforms/joomla3/administrator/index.php?option=com_contact&view=contacts
then the view class is correctly formed as view-contacts. However the layout is still incomplete probably because the layout is default.
<body class=" jsn-master tmpl-isis admin com_contact view-contacts layout-default task- itemid-0" data-basepath="/platforms/joomla3">
<body class=" jsn-master tmpl-isis admin com_contact view- layout- task- itemid-0" data-basepath="/platforms/joomla3">
Setting | Value |
---|---|
PHP Built On | Windows NT E6540 10.0 build 19042 (Windows 10) AMD64 |
Database Type | mysql |
Database Version | 5.5.5-10.4.10-MariaDB |
Database Collation | utf8mb4_unicode_ci |
Database Connection Collation | utf8mb4_general_ci |
PHP Version | 7.3.12 |
Web Server | Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.12 |
WebServer to PHP Interface | apache2handler |
Joomla! Version | Joomla! 3.9.24 Stable [ Amani ] 12-January-2021 15:00 GMT |
Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT |
User Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 |
This is an issue in Joomla 3 but I have checked in joomla 4 and get the following notes. I also again used com_contacts and the example
joomla4/administrator/index.php?option=com_contact
<body>
tag but with view-sysinfo which is new over Joomla 3 and again layout- + there is now task-<body class=" jsn-master tmpl-isis admin com_admin view-sysinfo layout- task- itemid-0" data-basepath="/platforms/joomla3">
joomla4/administrator/index.php?option=com_contact
I now get a different <body>
tag<body class="admin com_contact view- layout-default task-display">
Sidemenu --> Components -->Contacts --> Contacts
I get the following <body>
tag<body class="admin com_contact view-contacts layout-default task-display">
What this means is there is some inconsistencies with how these class names are created but has been partially fixed in Joomla 4.
This is not a show stopper but definately should be one of those things fixed in Joomla 4 if not in Joomla 3.
Labels |
Added:
?
|
Status | New | ⇒ | Confirmed |
I have just double checked the Joomlashine template issue. It was their system plugin adding jsn-master
and I have reported this to them. Here is me checking my results with the ISIS template but without the JSN system plugin running.
Alsojust notices that there is task-
showing incomplete like in Joomla 4.
Easy to handle if it is really needed. With com_contact for example, just add two lines of code below before this line https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_contact/controller.php#L42 and it should work as expected:
$this->input->set('view', $view);
$this->input->set('layout', $layout);
this issue is with all components, not just com_contacts
so it is an issue with the Joomla core and possibly how it handles default routes and that it does not add these variables into the request before Joomla builds the <body>
tag . i.e.
protected $default_view = 'contacts';
default
is assumed.display
We can handle it in display method of BaseController class. Adding these lines of code below after this line https://github.com/joomla/joomla-cms/blob/staging/libraries/src/MVC/Controller/BaseController.php#L619
$this->input->set('view', $viewName);
$this->input->set('layout', $viewLayout);
And that should work for all components. But I'm unsure if it is safe to do that.
What is the problem you are trying to solve
thats an easy one.
this changes the background globaly in the admin for my component
body.com_qwupdateserver {
background: #f9f9f9;
}
the next logical step is to use a page specific CSS
body.view-dashboard {
background: #f9f9f9;
}
Solutions
.view-dashboard
and view-
(messy)On a personal note i want all of my CSS and code to be neat and tidy and I dont like broken code.
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-03-09 20:55:30 |
Closed_By | ⇒ | rdeutz |
Please test and confirm that you have he same issue when using the joomla admin template and not the one from joomlashine