Template variables¤
Here is a list of all variables that are automatically available from inside the component's template and in on_render_before
/ on_render_after
hooks.
is_filled instance-attribute
¤
Dictonary describing which component slots are filled (True
) or are not (False
).
New in version 0.70
Use as {{ component_vars.is_filled }}
Example:
{# Render wrapping HTML only if the slot is defined #}
{% if component_vars.is_filled.my_slot %}
<div class="slot-wrapper">
{% slot "my_slot" / %}
</div>
{% endif %}
This is equivalent to checking if a given key is among the slot fills: