I have been stuck on the spot for hours already. Either I have a comprehension problem or I am looking to find a solution that is not implementable at all.
I am using the table-field plugin from ragi96
The output works perfectly with this code:
block-template:
<?php $table = $page->table()->toTable(); ?>
<?php if ($table != null): ?>
<table>
<?php foreach ($table as $tableRow): ?>
<tr>
<?php foreach ($tableRow as $tableCell): ?>
<td><?=$tableCell; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
In a layout, I also use tables.
However, no tables are displayed in the foreach output.
layout-template:
<?php foreach ($page->layout()->toLayouts() as $layout): ?>
<section id="<?= $layout->id() ?>">
<div class="container">
<div class="row">
<?php foreach ($layout->columns() as $column): ?>
<div class="col">
<?= $column->blocks() ?>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endforeach; ?>
Is it necessary to integrate an additional foreach loop for the table? If yes, at which position?
Or is it not possible, to output tables with the plugin?