{# Template to render a person OPTIONS * render string ['raw'|'label'|'bloc'] * addAltNames bool * addLink bool * addEntity bool * addId bool * addInfo bool * addAge bool * addCenter bool * hLevel integer * address_multiline bool * customButtons [ 'before' Twig\Markup, (injected with macro) 'replace' Twig\Markup, 'after' Twig\Markup ] * customArea [ 'beforeLabel' Twig\Markup, 'afterLabel' Twig\Markup, ] #} {% macro raw(person, options) %} {{ person.firstName }} {{ person.lastName }} {%- if options['addAltNames'] -%} {%- for n in person.altNames -%} {{- n.label -}} {%- endfor -%} {%- endif -%} {% endmacro raw %} {% macro label(person, options) %}
{%- if person.deathdate is not null -%} {%- if person.birthdate is not null -%} {# must be on one line to avoid spaces with dash #} – {%- else -%} {{ 'Date of death'|trans }}: {%- endif -%} {#- must be on one line to avoid spaces with dash -#} {% if options['addAge'] %} ({{ 'years_old'|trans({ 'age': person.age }) }}) {% endif %} {%- elseif person.birthdate is not null -%} {%- if options['addAge'] -%} ({{ 'years_old'|trans({ 'age': person.age }) }}) {%- endif -%} {%- endif -%}
{%- endif -%} {#- tricks to remove easily whitespace after template -#} {%- if true -%}