I was told by @Bakual to open a new issue for this so here it is.
PR #18571 added the ability to assign different layouts at a FIELD level (override for: "components/com_fields/layouts/fields/render.php" - so before knowing which field type it's going to render), which is great.
But in addition to this, we also need the ability to assign different layouts for individual values of specific field types that include multiple values, such as list, checkboxes, and repeatable/subform (for example, override for values of a list field would be: "plugins/fields/list/tmpl/list.php")
This can come useful in preparation for the repeatable/subform field finalization (#22446), as it would allow to create for example a table layout for the repeatable/subform field type as mentioned in #20243.
Or for example, as suggested by @laoneo in #20243, a UL layout for a list field type:
I would rather see a new function in core to define a default layout for the > field and provide different layouts for the same field type. For the list it would mean to add a new file > here like /plugins/fields/list/tmpl/list_ul.php and then provide these layouts as option in the field.
What do you guys think?
In the Field Editing it could look something like:
(Possibly for clarity we could rename the "Layout" option to "Field Layout")
And of course, the dropdown there would list the layout files ONLY for that field type. So a field of type "list" would only display files included in "/plugins/fields/list/tmpl/"
What do you think? Can you @laoneo or @Bakual or someone else create a PR for this?
Labels |
Added:
?
|
Title |
|
It probably doesn't make sense for plugins other than the custom fields ones. Since the other plugins (eg vote, pagebreak) only have one instance and already can be overridden. You don't need the possibility for more than one layout there.
For the custom field type plugins I can see a slim usecase to have multiple different layouts for the values since you can have multiple "instances" of the same plugin active.
Yeah, of course, this is just for custom fields, not meant for other plugins.
I probably don't have the time :-)
Me neither
Well, that's too bad :(
I'd do it myself if I had the knowledge to do it but unfortunately I don't.
It would be a pretty essential feature for the repeatable field as different ways to display it are very necessary for that (to the point where I would even consider packing some preset basic layouts, like a table, by default in the core)
Status | New | ⇒ | Discussion |
Category | ⇒ | com_fields |
Labels |
Added:
J3 Issue
|
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-24 15:28:13 |
Closed_By | ⇒ | joomla-cms-bot |
Closed_By | joomla-cms-bot | ⇒ | jwaisner |
Set to "closed" on behalf of @jwaisner by The JTracker Application at issues.joomla.org/joomla-cms/23138
Features are not available to be added to J3. Please review J4 and if this feature is still requested then please open a request.
Reopening and tagging "re-evaluate for j4"
I really dont understand why you are closing all these issues without even the courtesy of checking it yourself
Status | Closed | ⇒ | New |
Closed_Date | 2020-03-24 15:28:13 | ⇒ | |
Closed_By | jwaisner | ⇒ |
Labels |
Added:
?
Removed: J3 Issue |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-08-17 08:22:26 |
Closed_By | ⇒ | AndySDH | |
Labels |
Added:
?
No Code Attached Yet
Removed: ? ? |
It probably doesn't make sense for plugins other than the custom fields ones. Since the other plugins (eg vote, pagebreak) only have one instance and already can be overridden. You don't need the possibility for more than one layout there.
For the custom field type plugins I can see a slim usecase to have multiple different layouts for the values since you can have multiple "instances" of the same plugin active.
So if someone wants to have a take at it, go ahead. Best probably to create a new field similar to
JFormFieldComponentlayout
andJFormFieldModulelayout
and then add the proper logic to the custom field classes somewhere.