User tests: Successful: Unsuccessful:
Pull Request for Issue #32487 .
Because the 'class' XML attribute adds the class to the field itself rather than the outside container, it is not suitable for the classes added to #32422. This PR adds a parentclass
attribute which adds a class to the outside control-group
div.
Ensure #32422 works as described (updated to match)
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content com_messages com_users Templates (admin) NPM Change Layout Libraries |
Labels |
Added:
NPM Resource Changed
?
|
Category | Administration com_content com_messages com_users Templates (admin) NPM Change Layout Libraries | ⇒ | Administration com_content Layout Libraries |
Labels |
Removed:
NPM Resource Changed
|
Category | Administration com_content Layout Libraries | ⇒ | Administration com_config com_content Layout Libraries |
I have tested this item
Tested wit com_content: article edit, com_content config.xml, com_users: user edit
and an own J4 component;
Documentation will be required. It is a great improvement. Thank you.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
display
attribute is confusing, because after the display
you want to write block
. Yes, in general, and parentclass
is also not clear about which parent we are talking about. I suggest using the controlclass
attribute, we know that in the full sense of the control is just <div class= "control-group"/>
note
field and the spacer
field will be full-width.note
and spacer
fields, only between them will be distributed in 2-3 columns. This will allow you not to create a garbage can from the fields. And of course the ability to use the controlclass
attribute.hiddenLabel="true"
just a note: the code proposed is
if ($parentclass)
{
$class .= ' ' . $parentclass;
}
As it already adds a space, we do not need the space in your example in #32422
<field
name="article_layout"
type="componentlayout"
label="JFIELD_ALT_LAYOUT_LABEL"
class="form-select"
useglobal="true"
extension="com_content"
view="article"
parentclass=" span-4 stack"
/>
also, I do not understand why, in this PR you add stack to the article layout in administrator/components/com_content/forms/article.xml
as it does not have any effect.
Labels |
Added:
?
|
Category | Administration com_content Layout Libraries com_config | ⇒ | Administration com_config Layout Libraries |
@infograf768 My bad, I didn't mean to commit https://github.com/joomla/joomla-cms/pull/32488/files#diff-48dcb2f2108f7b07952c9c407fd23cab28677e3d2fd437030b2f04a043282320R280-R286 (reverted with cb121a5). The PR can remain in RTC as this class was ineffective.
And yes, no space is required in the example on #32422. I have edited this accordingly. Thanks for mentioning it!
@korenevskiy I guess the logic of parentclass
is that this class is been added to the parent div of the field that the rule is creating. Unlike the class
attribute, this does not add it to the control
class div.
@korenevskiy I guess the logic of
parentclass
is that this class is been added to the parent div of the field that the rule is creating. Unlike theclass
attribute, this does not add it to thecontrol
class div.
The control is < div class= "control-group" >
. But the field is < input >
. The field is located inside the control. The field has a parent that is a control. But the control also has a parent. It is intuitive for a layout designer who is unfamiliar with Joomla, but knows Bootstrap. ask which parent is being referred to when the class is specified, the parents of the control, or the parents of the field? But by specifying controlclass, it is clear that this is the class of the tag < div class="control group" >
.
let the class be added directly to <div class= "control-group">
this will allow you to position the label
at the same time.
Or can use another fieldclass
class
by the way, after all these tricks, the next step is this. 1. Creating an XML element to connect the CSS file to the form. 2. Create an XML tag to include Styles in the form.. Maybe this will be the right decision. This will be bad form for developers, but supporting such a feature is the right solution. I've seen modules where CSS is plugged in inside a custom field. This is worse than connecting directly to XML. but Joomla does not know how to do this.
You can consider a new attribute for <field>
, such as <field type="text" css="my_module.css"/>
@korenevskiy I guess the logic of
parentclass
is that this class is been added to the parent div of the field that the rule is creating. Unlike theclass
attribute, this does not add it to thecontrol
class div.
it is not clear from the name of the attribute which parent we are talking about
Not intuitive and unclear.
.
But <field controlclass="span-4 stack">
-> <div class= "control-group span-4 stack">
And now control will have a width across the entire GRID.
@korenevskiy As this PR is already set to RTC, I'll be unlikely to edit it further. Feel free to create a PR against this code once/if this gets merged
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-03-10 18:33:05 |
Closed_By | ⇒ | rdeutz |
I have tested this item✅ successfully on 7cef8cf
Tested in templateDetails.xml from Cassiopeia.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32488.