Replies: 1 comment
-
Done in Tetra 0.1.0 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Many times, in components you need to render some tags depending on a block being present or not, especially in "easy" BasicComponents:
E.g. In a Bootstrap card, if there is a title, I want to render a card-header > card-title div, and inside, the block with the title:
django-web-components do that like this:
Tetra can't do that. But Tetra components could support a
blocks
(orblock
) variable that just has booleans as members, named after the available blocks. So you could use{% if blocks.title %} <div class="foo">{% block title %}</div>{% endif %}
So the wrapper div is not rendered if the block is not present.
This would ease creating components a lot.
Beta Was this translation helpful? Give feedback.
All reactions