Making your hookables configurable
Sometimes when you are creating a bundle or a reusable template for different hookables, you might want to provide a way to adjust it to a given context. Thanks to the configuration data bag, you are able to achieve it easily.
While using a hookable template, you can access configuration
keys via hookable_metadata
Twig var using hookable_metadata.configuration.<key_name>
or get_hookable_configuration().<key_name>
.
Example
index.html.twig
generic_field.html.twig
twig_hooks.yaml
Last updated