ux
ux copied to clipboard
[TwigComponent] Pass HTML through several components
Hello,
First of all, I would like to thank you all for your dedication on this project.
I am currently refactoring the UX of a small project to use TwigComponents but I am struggling on passing block through several components. It may probably be something I misunderstandd as I am pretty new on the matter, but I can find no clue in documentation and issues.
Let's say I have three components A, B and C. A:
<div id="A">
{% block body %}
Default A body
{% endblock %}
</div>
B:
<div id="B">
<twig:A>
<twig:block name="body">
Default B body
</twig:block>
</twig:A>
</div>
C:
<div id="C">
<twig:B>
<twig:block name="body">
Expected body
</twig:block>
</twig:B>
</div>
I would expect the C body to be displayed but have the default B body instead.
Is there a way to make it work ? Or is there another way to pass HTML through several components ? Thank you if you can help a beginner !