Replies: 1 comment 1 reply
-
Hi, i didn't find a solution so i did a bit of reverse enginnering and i found a solution, it could be prettier but it works. Let's say you have a block with a repeater and on each repeater item you have a 'class' input and a block called 'content' (it was a customizable grid) This is the code of your block view (resources/views/site/blocks/.blade.php): <div class="row">
{{-- - You must iterate over $renderData and NOT $block childrens --}}
@foreach ($renderData->children as $childRender)
@php
$childRenderData = $childRender->renderData; ///<<< this is the renderData of the child
$child = $childRenderData->block; ///<<< this is our child block
@endphp
<div class="{{ $child->input('class') ?? 'col' }}">{!! $childRenderData->renderChildren('content') !!}</div>
@endforeach
</div> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an accordion block, which has a repeater for accordion items. Every accordion item has a block editor, to allow nested blocks.
Normally to render nested blocks you can say something like
{!! $renderData->renderChildren('subblocks') !!}
, but how to render the subblocks of each of the repeater items?Beta Was this translation helpful? Give feedback.
All reactions