Closed wallythewebdev closed 2 years ago
Hello, You can use a mix of both simple rendering and advanced displaying. It can be something like:
{{ form.open() }}
{% set count = 1 %}
{% for field in form.fields %}
{% switch field.name %}
{% case "name" or "email" %}
{% if count == 1 %}
<div class="field-group">
{% endif %}
{{ field.render() }}
{% if count == 2 %}
</div>
{% endif %}
{% set count = count+1 %}
{% default %}
{{ field.render() }}
{% endswitch %}
{{ wheelformErrors[field.name] is defined ? errorList(wheelformErrors[field.name]) }}
{% endfor %}
{{ form.close() }}
adjusted it to the number of fields and keep the fields together in the backend.
Amazing thanks for the super quick response like always :) I'll get cooking with this right away - could I also, open an idea for a feature request, of being able to group elements in the Plugin interface? Happy to dive into more detail if that helps:
Again thanks for the help :)
Hello, No problem, That's a common requested feature. It's a significant undertaking that's why it's been sitting on the backburner for now.
Gotcha - its a "nice to have" for sure - but if there is a hard code way of doing this as well then it doesn't break anything. Thanks again :)
Hi - Was just wondering if I can wrap some inputs together (when auto generating the form fields).
So, currently form items are being added in a wf-group div:
I was hoping to consolidate these into one wf-group?
I can do it if I add in the html field and create a div with a class:
This ends up putting them into the same div:
But this is not very neat and a pretty bad authoring experience if someone was to make some edits to the form in future - is there another way to do this?
Thanks for any help - W