This patch introduces a simple Twig filter that allows formatting a name directly within a template.
It leverages the NameFormatterInterface.
With this change, you can easily format name fields in templates without creating custom preprocess functions.
Example usage:
{{ entity.your_name_field.value[0]|format_name('your_custom_format') }}
What about it ?
Jo
| Comment | File | Size | Author |
|---|---|---|---|
| name-format_name_twigextension.patch | 1.44 KB | johaziel |
Issue fork name-3553196
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
bluegeek9 commented