? ? Pending

User tests: Successful: Unsuccessful:

avatar ciar4n
ciar4n
21 Feb 2021

Pull Request for Issue #32487 .

Summary of Changes

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.

Testing Instructions

Ensure #32422 works as described (updated to match)

Documentation Changes Required

avatar ciar4n ciar4n - open - 21 Feb 2021
avatar ciar4n ciar4n - change - 21 Feb 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Feb 2021
Category Administration com_content com_messages com_users Templates (admin) NPM Change Layout Libraries
avatar ciar4n ciar4n - change - 21 Feb 2021
Labels Added: NPM Resource Changed ?
avatar ciar4n ciar4n - change - 21 Feb 2021
The description was changed
avatar ciar4n ciar4n - edited - 21 Feb 2021
avatar drmenzelit drmenzelit - test_item - 22 Feb 2021 - Tested successfully
avatar drmenzelit
drmenzelit - comment - 22 Feb 2021

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.

avatar chmst
chmst - comment - 5 Mar 2021

I have tested in com_content, article.xml and there it works fine.

grafik

But in Options (config.xml) there is no effect.

grafik

avatar joomla-cms-bot joomla-cms-bot - change - 6 Mar 2021
Category Administration com_content com_messages com_users Templates (admin) NPM Change Layout Libraries Administration com_content Layout Libraries
avatar ciar4n
ciar4n - comment - 6 Mar 2021

@chmst Thank you for testing.

Strangely I am unable to replicate this issue. Adding to ..\administrator\components\com_config\forms\application.xml for example parentclass="span-2" works without issue.

image

avatar ciar4n
ciar4n - comment - 6 Mar 2021

@chmst My apologies. I see the issue now in component tabs as you said. I'll submit a fix.

avatar ciar4n ciar4n - change - 6 Mar 2021
Labels Removed: NPM Resource Changed
avatar joomla-cms-bot joomla-cms-bot - change - 6 Mar 2021
Category Administration com_content Layout Libraries Administration com_config com_content Layout Libraries
avatar ciar4n
ciar4n - comment - 6 Mar 2021

@chmst Should be good now. ?

avatar chmst chmst - test_item - 6 Mar 2021 - Tested successfully
avatar chmst
chmst - comment - 6 Mar 2021

I have tested this item successfully on 780fdc4

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.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32488.

avatar drmenzelit drmenzelit - test_item - 7 Mar 2021 - Tested successfully
avatar drmenzelit
drmenzelit - comment - 7 Mar 2021

I have tested this item successfully on 780fdc4


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32488.

avatar Quy Quy - edited - 7 Mar 2021
avatar Quy Quy - change - 7 Mar 2021
Status Pending Ready to Commit
avatar Quy
Quy - comment - 7 Mar 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32488.

avatar korenevskiy
korenevskiy - comment - 7 Mar 2021
  1. Using the 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"/>
  2. I suggest making the layout multi-column. But with the observance of several rules. the note field and the spacer field will be full-width.
    Controls located between the 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.
    But having the ability to override the default classes and set your own width in the number of columns.
    .
    In any case, now in Joomla Nightly 1 column mode, by analogy J3, looks better. 1 column is clearer and the most important thing is available. I propose to center 1 column in the middle.
    .
    How do I output a control-table without a Label?
    img-2021-03-07-23-58-39
avatar brianteeman
brianteeman - comment - 7 Mar 2021

hiddenLabel="true"

avatar infograf768
infograf768 - comment - 8 Mar 2021

@ciar4n

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.

https://github.com/joomla/joomla-cms/pull/32488/files#diff-48dcb2f2108f7b07952c9c407fd23cab28677e3d2fd437030b2f04a043282320R280-R286

avatar ciar4n ciar4n - change - 8 Mar 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 8 Mar 2021
Category Administration com_content Layout Libraries com_config Administration com_config Layout Libraries
avatar ciar4n
ciar4n - comment - 8 Mar 2021

@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!

avatar ciar4n
ciar4n - comment - 9 Mar 2021

@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.

avatar korenevskiy
korenevskiy - comment - 9 Mar 2021

@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.

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

avatar korenevskiy
korenevskiy - comment - 9 Mar 2021

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"/>

avatar korenevskiy
korenevskiy - comment - 9 Mar 2021

@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.

img-2021-03-09-13-35-32
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.

avatar ciar4n
ciar4n - comment - 9 Mar 2021

@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 ?

avatar rdeutz rdeutz - close - 10 Mar 2021
avatar rdeutz rdeutz - merge - 10 Mar 2021
avatar rdeutz rdeutz - change - 10 Mar 2021
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

Add a Comment

Login with GitHub to post a comment