💡 Tips
To configure a date
, datetime
or dateinterval
field to use HTML5's standard date picker widget, set the options as this example:
To configure a choice
field to show checkboxes, set the options as this example:
A single checkbox can be added like this:
Note that when using form_div_layout.html.twig
as layout in bolt-boltforms.yaml
, checkboxes and radio-buttons do not show labels by default.
If you want to use this layout, it's advised to copy it to your theme folder, change its name, modify it, and configure it like this:
More options regarding the choice
field are available on the official Symfony Forms documentation page.
Using Content as Choices¶
With type: contenttype
, you can use content as choices. This makes additional params
option is available.
These are the same options as what you'd use for regular setcontent
queries.
Options for choice
are available here; choices
will be overwritten by the queried values.
The following options are available for params
:
contenttype
: the contenttype to query.label
: the name of the field to use as labels.value
: the name of the field to use as values.limit
: the number of records to return.sort
: the field value to sort on; prefix with-
for descending order.criteria
: thewhere
clause.