? No Code Attached Yet
avatar AndySDH
AndySDH
22 Nov 2018

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:

image
(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?

avatar AndySDH AndySDH - open - 22 Nov 2018
avatar joomla-cms-bot joomla-cms-bot - change - 22 Nov 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Nov 2018
avatar AndySDH AndySDH - edited - 22 Nov 2018
avatar AndySDH AndySDH - change - 22 Nov 2018
The description was changed
avatar AndySDH AndySDH - change - 22 Nov 2018
The description was changed
avatar AndySDH AndySDH - edited - 22 Nov 2018
avatar AndySDH AndySDH - change - 22 Nov 2018
Title
Ability to create and assign alternate layout to custom fields values
[com_fields] Ability to create and assign alternate layout to custom fields values
avatar AndySDH AndySDH - edited - 22 Nov 2018
avatar AndySDH AndySDH - change - 22 Nov 2018
The description was changed
avatar AndySDH AndySDH - edited - 22 Nov 2018
avatar AndySDH AndySDH - change - 22 Nov 2018
The description was changed
avatar AndySDH AndySDH - edited - 22 Nov 2018
avatar AndySDH AndySDH - change - 22 Nov 2018
The description was changed
avatar AndySDH AndySDH - edited - 22 Nov 2018
avatar AndySDH AndySDH - change - 22 Nov 2018
The description was changed
avatar AndySDH AndySDH - edited - 22 Nov 2018
avatar Bakual
Bakual - comment - 22 Nov 2018

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 and JFormFieldModulelayout and then add the proper logic to the custom field classes somewhere.

avatar AndySDH
AndySDH - comment - 22 Nov 2018

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.

avatar Bakual
Bakual - comment - 22 Nov 2018

I probably don't have the time :-)

avatar laoneo
laoneo - comment - 23 Nov 2018

Me neither

avatar AndySDH
AndySDH - comment - 23 Nov 2018

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)

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Category com_fields
avatar franz-wohlkoenig franz-wohlkoenig - unlabeled - 4 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 4 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 24 Mar 2020
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2020-03-24 15:28:13
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 24 Mar 2020
avatar jwaisner jwaisner - change - 24 Mar 2020
Closed_By joomla-cms-bot jwaisner
avatar joomla-cms-bot
joomla-cms-bot - comment - 24 Mar 2020

Set to "closed" on behalf of @jwaisner by The JTracker Application at issues.joomla.org/joomla-cms/23138

avatar jwaisner
jwaisner - comment - 24 Mar 2020

Features are not available to be added to J3. Please review J4 and if this feature is still requested then please open a request.


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

avatar brianteeman
brianteeman - comment - 24 Mar 2020

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

avatar brianteeman brianteeman - change - 24 Mar 2020
Status Closed New
Closed_Date 2020-03-24 15:28:13
Closed_By jwaisner
avatar brianteeman brianteeman - reopen - 24 Mar 2020
avatar brianteeman brianteeman - change - 24 Mar 2020
Labels Added: ?
Removed: J3 Issue
avatar brianteeman brianteeman - unlabeled - 24 Mar 2020
avatar brianteeman brianteeman - labeled - 24 Mar 2020
avatar AndySDH AndySDH - change - 17 Aug 2021
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: ? ?
avatar AndySDH AndySDH - close - 17 Aug 2021

Add a Comment

Login with GitHub to post a comment