diff --git a/docs/notification-center-pro/custom-tokens/example-collection/_index.de.md b/docs/notification-center-pro/custom-tokens/example-collection/_index.de.md index 67548b9..963d24e 100644 --- a/docs/notification-center-pro/custom-tokens/example-collection/_index.de.md +++ b/docs/notification-center-pro/custom-tokens/example-collection/_index.de.md @@ -24,9 +24,11 @@ Gesamttotal: ##gesamttotal## So könnte unsere Twig-Logik könnte dann wie folgt aussehen: ```twig -{% set subtotal = rawTokens.byName('form_anzahl_prospekte').value * 4 %} -{% set mwst = subtotal * 19 / 100 %} -{% set gesamttotal = subtotal + mwst %} +{% if rawTokens.has('form_anzahl_prospekte') %} + {% set subtotal = rawTokens.byName('form_anzahl_prospekte').value * 4 %} + {% set mwst = subtotal * 19 / 100 %} + {% set gesamttotal = subtotal + mwst %} +{% endif %} ``` Diese Logik kopieren wir nun in 3 Tokens und geben jeweils die gewünschte Variable aus: diff --git a/docs/notification-center-pro/custom-tokens/example-collection/_index.en.md b/docs/notification-center-pro/custom-tokens/example-collection/_index.en.md index f402cba..5122194 100644 --- a/docs/notification-center-pro/custom-tokens/example-collection/_index.en.md +++ b/docs/notification-center-pro/custom-tokens/example-collection/_index.en.md @@ -23,9 +23,11 @@ Total amount: ##total## So könnte unsere Twig-Logik könnte dann wie folgt aussehen: ```twig -{% set subtotal = rawTokens.byName('form_number_of_brochures').value * 4 %} -{% set tax = subtotal * 19 / 100 %} -{% set total = subtotal + tax %} +{% if rawTokens.has('form_anzahl_prospekte') %} + {% set subtotal = rawTokens.byName('form_number_of_brochures').value * 4 %} + {% set tax = subtotal * 19 / 100 %} + {% set total = subtotal + tax %} +{% endif %} ``` We now copy this logic into 3 tokens and output the desired variable in each case: