It's currently possible to:
but it is not possible to add a class to the module content/card-body only.
In my case I wanted to add (for one module only, not all modules of that type in that position), assign it to the 'side-bar' left position and then add a class (a version of grid-child or some other code) to the body of 'three-cols' so that the list on medium screens would display in four then three then two columns depending on screen width:
instead of one long single-column list with a large gap to the side:
Or someone might want to apply a different background to that card body.
Yes, it could be done in user.css but would need to be done, I believe, for each individual module. Far easier to apply an existing class to whichever card requires it, particularly if the user creating the module doesn't have access to the template files.
So, in the module setup under the Advanced tab, as well as 'Module Class' and 'Header Class' there would be a 'Body Class' and the 'card' chrome would reflect this with additional code after line 29 along the lines of:
$bodyClass = htmlspecialchars($params->get('body_class', ''), ENT_QUOTES, 'UTF-8');
and line 57 would change to something like:
<div class="card-body <?php echo $bodyClass; ?>">
[with a space after 'card-body' so that the class is rendered correctly]
I expect other additions would be needed.
Labels |
Added:
No Code Attached Yet
|
Yes, I can see that I can select a custom chrome from the 'Module Style' [shouldn't this be called 'Module Chrome'?] but:
say there's custom CSS for a corporate colour to be used as the background in certain cases e.g.
.custom-colour {
background-color: #d8b5ff;
}
For whatever reason, a user might want to apply that corporate background colour to the card body of a selected custom module, a newsflash module or any other type of module in different positions. Unless I understand incorrectly, your suggestion means having to create a custom chrome for each potential position and layout, instead of just applying 'custom-colour' to my proposed bodyClass field for the module content/card body.
Labels |
Added:
Feature
|
Module chrome defines how a module gets rendered you can find the existing in layouts/chromes. Moving the issue to discussions, doesn't seens to me something we need to implement.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-04-11 15:09:27 |
Closed_By | ⇒ | rdeutz |
Why not create your own chrome for this specific case?