^ "Page not found: configuration/menus"
^ "Page not found: configuration/routing"
^ "Page not found: console-command/setup/setup-deploy"
^ "Page not found: other/locales"
^ "Page not found: howto/twig-changes-in-bolt4"
field_factory | Bolt Documentation
Edit on GitHub
Jump to docs navigation

Twig Components / Methods / field_factory

Note: You are currently reading the documentation for Bolt 5.0. Looking for the documentation for Bolt 5.2 instead?

field_factory(name, definition = null) is a Twig function to create a field on the fly with a name and optional definition.

Parameter Description
name The name of the field
definition The definition of the field, same options as a field definition in contenttypes.yaml
{% set field = field_factory('title', { 'type': 'text', 'label' : 'Awesome title' }) %}

Source: Forms



Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.