Twig https://gnuschichten.de/ de Drupal Twig VarDumper Module https://gnuschichten.de/snippets/drupal-vardumper-module <span class="field field--name-title field--type-string field--label-hidden">Drupal Twig VarDumper Module</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="https://gnuschichten.de/user/6" typeof="schema:Person" property="schema:name" datatype="" xml:lang="">Holger Weischenberg</span></span> <span class="field field--name-created field--type-created field--label-hidden">Di., 20.10.2020 - 12:23</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Dump Beispiel mit dem <a href="https://www.drupal.org/project/twig_vardumper">Twig VarDumper Contrib-Modul</a>.<br />  </p> <pre> <code class="language-php">{% set price = package.get('field_price').value %} {% set dossier = payment.getDossier() %} {{ dump(user.account.roles|last) }} {{ dump(package.field_ref_role.target_id) }} {{ dump() }} {% set price_type = price > 0 ? package.get('field_price_type').get(0)|list_integer_string|t : '' %} {% set lifetime = package.get('field_lifetime_type').get(0)|list_integer_string|t %} {% if invite_form %} <h2>{{ 'Lorem ipsum dolor sit amet'|t }}</h2> {% else %} {% if user.account.roles|last != package.field_ref_role.target_id %} {% if package.get('title').value == "Select 30" %} <h2>{{ 'Lorem ipsum dolor sit amet @tarif tariff (@price EURO; duration @lifetime)'|t({ '@tarif': package.get('title').value, '@price': price|format_price(''), '@separator': price > 0 ? ' ' : ' ', '@lifetime': lifetime }) }}</h2> {% else %} <h2>{{ 'Lorem ipsum dolor sit amet@tarif tariff (@price EURO@separator@price_type; duration @lifetime)'|t({ '@tarif': package.get('title').value, '@price': price|format_price(''), '@separator': price > 0 ? ' ' : ' ', '@price_type': 'pro Monat', '@lifetime': lifetime }) }}</h2> {% endif %} {% endif %} {% if dossier %} <h2>{{ 'Selected dossier "@dossier" (@price EURO)'|t({ '@dossier': dossier.label(), '@price': payment.getAmountDossierRaw()|format_price('') }) }}</h2> {% endif %} {% endif %} {{ package.get('field_notice_ext').value|raw }}</code></pre> <p> </p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field__label">Tags</div> <div class="field__items"> <div class="field__item"><a href="https://gnuschichten.de/taxonomy/term/15" hreflang="de">Twig</a></div> </div> </div> Tue, 20 Oct 2020 10:23:52 +0000 Holger Weischenberg 11 at https://gnuschichten.de