As detailed in the description for #1843798: [meta] Refactor Render API to be OO → , we currently do not have a drillable, accessible way of getting to variables that a themer may anticipate being available to a parent template. This is because variables in a sub-element may be invoked by a preprocessor that runs later.
Example from a node template:
<!-- First image, with manual tag creation -->
{{ hide(content.field_image.0) }}
<img class="banner" src="{{ content.field_image.0.attrs.src }}" alt="{{ content.field_image.0.attrs.alt }}" />
<!-- Remaining content -->
{{ content }}
<!-- Links -->
{{ links }}
<!-- Comments -->
{{ comments }}
Before the larger, long-term goals of #1843798: [meta] Refactor Render API to be OO → are achieved, we'd like to get a stopgap for better drillability support in Drupal 8, at least for the Twig engine.
Provide a way for Twig to understand which variables need to be available to a template and adjust how they are prepared beforehand. Twig's compilation steps may offer us some insight into implementation.
None
Improved Twig syntax from what currently exists (that requires manual prep/rendering).
Closed: outdated
10.1 ✨
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.