attributes:
my_attribute:
label: This is some text with no input
style: "display:none"
value: null
Which is still only a ‘label’ and not a proper formatted text.
Would it be possible to add elements which are not really input?
I was wondering if it can be possible to add “custom” HTML code into the form as an element.
Any idea?
I’m not sure if you can do this. It appears that the label always shows up, so that’s really the only viable place to put text, unless maybe the help section? But either way - the label is always going to show.
I don’t think you can do this out of the box without modifying some source code.
I understand that’s a form and only have “form” elements. Still you may want to add some formatting like grouping elements in sections by defining some “headings” in between some elements.
Ex:
I’m not a ruby expert but I was wondering if we can have a widget type “custom_html” which just renders what you add as string (HTML code) to enable adding some custom HTML elements in between the form elements.
So the form.yml may look like:
This is possible in a quite hacky way right now, but proper support for these types of elements would be very nice to have.
We currently do this to create headings between form elements:
Many thanks! I looked for hours for the “skip_label”!
Actually, I first tried to format the content of the label but it seems the content is escaped and the page will show the plain HTML you pass as label.
Now, skipping the label creation it is possible to format the input defining the style in the element directly: