{# 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 * addDeath bool * addAgeBadge bool * suffixText bool * 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['addDeath'] -%} {% if person.deathdate is not null %} (‡){% endif %} {% endif %} {%- if options['addAltNames'] -%} {%- for n in person.altNames -%} {{- n.label -}} {%- endfor -%} {%- endif -%} {%- if options['addAgeBadge'] -%} {% if person.age is not null and person.deathDate is null %} ({{- 'years_old'|trans({ 'age': person.age }) -}}) {% endif %} {% endif %} {%- if options['suffixText'] is defined -%} {% for o in options['suffixText'] %} {{ o }} {% 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 -%}