symfony / ux

Symfony UX initiative: a JavaScript ecosystem for Symfony
https://ux.symfony.com/
MIT License
824 stars 298 forks source link

[TwigComponent] Pass HTML through several components #1479

Open mbuliard opened 7 months ago

mbuliard commented 7 months ago

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 !

carsonbot commented 1 month ago

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot commented 1 month ago

Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3

carsonbot commented 3 weeks ago

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!