lazy-blocks icon indicating copy to clipboard operation
lazy-blocks copied to clipboard

Repeater in repeater

Open JohannesDeml opened this issue 6 years ago • 2 comments
trafficstars

From what I can tell it is not possible to add a repeater in a repeater. My usecase for that would be a simple description list. A description list can have multiple description terms which again can have multiple description details. The frontend html would look like this:

 <div class="description-container">
   <dl>
    {{#each entry}}
    <dt>{{description_term}}</dt>
    {{#each detail_entry}}
    <dd>{{description_details}}</dd>
    {{/each}}
    {{/each}}
  </dl>
</div>

Is there any reason this is not supported? And how hard would it be to implement? I haven't done any wordpress plugin development so far, but I do know my way around php. :)

JohannesDeml avatar Jul 04 '19 20:07 JohannesDeml

The reason is simple - for now, I don't have a normal, not hacky solution. If someone has any solutions, welcome to https://github.com/nk-o/lazy-blocks/pulls

Currently limited to 1 nesting level

  • https://github.com/nk-o/lazy-blocks/blob/a8bb74df246f9d72eb98675518d7c407d41dd56f/src/assets/js/index.jsx#L68-L74
  • https://github.com/nk-o/lazy-blocks/blob/a8bb74df246f9d72eb98675518d7c407d41dd56f/src/assets/js/index.jsx#L114-L124

nk-o avatar Aug 12 '19 09:08 nk-o

Hi @nk-o

Thanks for the response and pointing me in the direction I have to look at. Hopefully I will find the time to solve the problem and create a PR.

JohannesDeml avatar Aug 13 '19 07:08 JohannesDeml