You can get the paragraphs in your nodes ready for the ToC module using these Twig templates.
twig
ternary-example.html.twig
{# Checks if a URL exists and passes it to the component. Otherwise, sets it to false. Works with primitive data types. #}
{% set link = url ? { url: url } : false %}
{# Checks if the media object is not empty and passes it to the component. Otherwise, sets it to false. Suitable for complex data types like objects. #}
{% set media = media is not empty ? { media: media } : false %}
13.11.2025 | Lothar Ferreira Neumann
Use ternary statements in Twig
We will use the form_decorator module to alter the output of the gin_login module to look something like this:
This DevBit provides a step-by-step tutorial how to get there.
23.04.2026 | Lothar Ferreira Neumann
Add custom text to gin_login with Form Decorator
development.services.yml
parameters:
twig.config:
debug: true
auto_reload: null
cache: false
22.06.2026 | Mathias Grab
How to enable Twig debug in Drupal
13.11.2025 | Peter Gerken