Configurate text and value for prevalues in dropdown #11084
Replies: 2 comments
-
Regarding color picker devlopers may just use the color code directly as inline styles in frontend, while in other scenarios it makes more sence the store a different value like a value used as class name or data attribute value. Currently we would have to either transform the color in view or controller, create our own color picker property editor or use a package like Contentment. |
Beta Was this translation helpful? Give feedback.
-
I was just about to write my own editors to do this exact thing. I don’t think I ever use dropdowns, radio buttons or checkboxes without having to parse them in the view. More often than not I also have to code a fall back value if nothing was selected. I would like be able to:
|
Beta Was this translation helpful? Give feedback.
-
In property editors like dropdown, checkbox list and radiobutton list we can configurate prevalues.
However currently there is no way to configurate both text and value and also default selected option(s).
Often you don't want the label is the same as the stored value, but currently we may need to resolve the value in e.g. razor view, so
None
would be mapped to a value likeg-0
(no gutter).It would could specify the specific value (which editors don't see), it would in many cases require less code in views.
Not sure what the best approach would be, but it could be something like this with toggles. By default it could generate a lowercase value from the label/text and replace e.g. space with hyphen.
and a bit similar to color picker which allow to specific value and label.
Beta Was this translation helpful? Give feedback.
All reactions