[4.0] Remove "bootstrap_size" field#18957
[4.0] Remove "bootstrap_size" field#18957C-Lodder wants to merge 3 commits intojoomla:4.0-devfrom C-Lodder:bs-size
Conversation
| $moduleTag = $params->get('module_tag', 'div'); | ||
| $headerTag = htmlspecialchars($params->get('header_tag', 'h4')); | ||
| $headerClass = htmlspecialchars($params->get('header_class', '')); | ||
| $modulePos = $module->position; |
| $moduleTag = $params->get('module_tag', 'div'); | ||
| $headerTag = htmlspecialchars($params->get('header_tag', 'h4')); | ||
| $headerClass = htmlspecialchars($params->get('header_class', '')); | ||
| $modulePos = $module->position; |
| $headerClass = ($headerClass) ? ' ' . htmlspecialchars($headerClass) : ''; | ||
|
|
||
| echo '<div class="' . $moduleClass . '">'; | ||
| echo '<div class="col-md-6">'; |
There was a problem hiding this comment.
Does it make sense to hardcode that class here? Wasn't the intent to be able to use the module class (suffix) parameter to set a width? If it's done like this, there will be no way to change the width.
There was a problem hiding this comment.
The module class suffix is for styling related classes, which should never be applied to grid related elements.
Incorrect:
.myclass {
padding: 100px;
margin: 20px;
background: #000;
}
<div class="col-md-6 myclass">
</div>
Correct:
.myclass {
padding: 100px;
margin: 20px;
background: #000;
}
<div class="col-md-6">
<div class="myclass"></div>
</div>
There was a problem hiding this comment.
Our aim to deal with the widths for the cpanel modules will come at a later date (future PR)
There was a problem hiding this comment.
You don't do any specific for the cpanel modules. You do something for any modules on any position and any templates or it is wrong.
I don't understand why you want to make a difference between grid and design. Both are CSS classes in the end. Btw, you forgot one option in your examples 😄
.myclass > div {
padding: 100px;
margin: 20px;
background: #000;
}
<div class="col-md-6 myclass">
<div>...</div>
</div>
The problem with the current module suffix code is that it is often applied both by the module chrome and the module itself, making the suffix appear twice and thus breaking a lot of CSS. But that is bad design in the module code, not a problem with the parameter itself 😄
There was a problem hiding this comment.
I purposely did use the CSS example you provided because the next child element may not be a <div>.
The modules in the FE template don't support the bootstrap widths anymore as the page structure is defined using css-grid.
If you assign 4 modules to the top-a position for example, they will be evenly divided into a 4 column grid. If you want to start adjusting page structures, then you need do this at template level, where it should be done.
There was a problem hiding this comment.
Yep, stripping it out is fine. Don't get me wrong. But by hardcoding the class col-md-6 into the module chrome, you hardcode that chrome to always use 50% width. That's what I mean which is wrong. The chrome itself shouldn't apply width (grid) related formatting at all by itself.
That chrome isn't necessary restricted to the cpanel. It may for example as well be used by 3rd parties withing their backend if they use own module positions, or the user may apply the chrome to a module in another position.
So what speaks against removing the hardcoded col.md-6 here and add it to the modules that are shown? Or if you don't want to do that in each module, you can always do what we do today and set it in the cpanel layout as default value.
There was a problem hiding this comment.
Like I said, we'll deal with the module widths more appropriately once we've discussed the best solution internally. Of course I don't want to leave the col-md-6 hardcoded in there
There was a problem hiding this comment.
Yep I saw that and it uses the module class parameter like I suggested to do here as well. That's why I'm confused.
There was a problem hiding this comment.
Not using bootstrap opens up some options. With no longer such a tight coupling to the markup we can use the module class field for both styling and layout. The downside been we have to custom write the CSS. We already do so with the likes of #18319.
|
removing the param I think is the wrong direction. The whole purpose was to give the user flexibility in sizing the module. Now you've not only removed that ability but forced them into a fixed state. i.e. we're back into 1.5 days. |
|
Please read all the comments @N6REJ |
|
@N6REJ The page structure has absolutely no association with Bootstrap. We do NOT use Bootstrap column classes anymore for Cassiopeia. We are utilising CSS Grid which may be a "1.5 days" approach to you, but a 2017 approach to all UI developers |
|
@C-Lodder you state that put yet you put the column class in! I can only go by what you say/show/do. |
|
The UI options are inherently limited without templates putting in their own parameters. Do we offer params mapping to just Long and short, the only reliable way to offer these sizing parameters is to continue to use HTML driven grids. Those have issues and limitations that are addressed by the newer CSS Grid implementations and it has been elected to focus on adapting our technology toward newer and preferred trends, not sticking to inherently broken and limited options. |
|
@N6REJ - The backend and frontend templates are 2 completely different things. In the FE template we're using CSS grid for the page structure, whereas in Atum we're still using BS4.
As you can see by my actual code changes, I do not use |
|
@C-Lodder can you please give Test Instructions in your first Comment so Tester are sure where to look? |
|
@mbabker I see what you mean. Is there anyway to allow the flexibility of module size param and non-rigid classes also without resorting to forcing the users to create css sizing? |
|
Franz, this is only to remove a parameter. Just a code revoew will do |
Templates use the existing plugin events to extend the module edit form then use their extended parameters in the module chrome. An option that has always existed so that there isn't a reliance on trying to map a select list offering a mapping to BS2 |
Anywhere explaining the details / how's of that anywhere? |
|
@Quy done |
|
@wilsonge merge? |
|
@wilsonge @brianteeman are we removing the Bootstrap size parameter in modules? With the use of CSS Grid make no sense to keep a setting that is bootstrap related. |
Pull Request for Issue #18866
Summary of Changes
This PR removed every reference to the
bootstrap_sizefield for modules