User tests: Successful: Unsuccessful:
This PR adds support for inline subforms. It will be possible to define the subform as XML content directly inside the main XML file. It will behave similar to repeatable forms. How it will look like can be found in the testing instructions.
If this PR will get merged, then we can move the custom fields list to subforms.
Put the following XML code into the file administrator/components/com_content/models/forms/article.xml after line 162 (inside the basic fieldset in the attribs tag).
<field name="demo" type="subform" label="Subform" multiple="true">
<form>
<field name="name"
label="Name"
size="30" type="text" />
<field name="value"
label="Value"
size="30" type="text" />
</form>
</field>
In the options tab should appear a sub form like:
An error is show, that the form could not be loaded.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
looks as good idea
but the main form ignores the fields inside subform field? I had some problem with this before, they was rendered as part of the main form
actually that was a main reason why I have used an external file as source, instead of the children elements
it also more safe to have external file, when some extension use simpel //field
XPath in his code, for whatever reason
Yes, I worked on JForm recently, but I don't really know anything about this here. Also, my changes are aimed at 4.0.
I have tested this item
Thank you, works like expected
Category | Libraries | ⇒ | Libraries Unit Tests |
@Fedik I guess I solved with some updated XPath queries. The fields in the subform should not being rendered anymore in the main form and slo not overwrite some existing fields. Can you also do some testing as you are the subform master chief
@coolcat-creations probably you need to test it again.
yes, something like that
I try to test when will get some more time
works,
but still some issue, when you do the subform with fieldsets, then the main form rendered wrong:
I tried to test in module params.
<field name="demo" type="subform" label="Subform" multiple="true" groupByFieldset="true">
<form>
<fieldset name="test1" label="test1">
<field name="name" label="Name" type="text" />
</fieldset>
<fieldset name="test2" label="test2">
<field name="value" label="Value" type="text" />
</fieldset>
</form>
</field>
I think that the reason is the same as was with <field>
inside <field>
I have tested this item
@coolcat-creations can you also test it again, then we can set it to RTC and are able to use subforms for custom fields.
I have tested this item
Works as expected. Thank you Allon.
Milestone |
Added: |
||
Status | Pending | ⇒ | Ready to Commit |
Labels |
RTC
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-12-04 11:05:53 |
Closed_By | ⇒ | rdeutz |
Thanks
Hi,
sorry I don't understand how I can use this now in my articles?
Have I do a corehack for this or is this also usable with the custom fields?
Calling @Fedik, does this change make sense?