Hello again!
I got a specific question how to fetch specifical data from another subpage. I’ve got a page receipe.txt with following data
Title: Pizza Receipe
----
ReceipeID: 136-018-A
----
Date: 2018-09-21
----
Text: Get the best pizza
Now we go to another page where i want to add via Kirby Builder the Pizza receipe block. That page is receipe-overview.txt.
Now there I have following filterby component:
<?php foreach($site->index()->filterBy('receipeID, '*=', 'HOW TO CALL RECEIPE ID?') as $item): ?>
<h2><?= $item->title()->html() ?></h2>
<?= $item->text()->kirbytext() ?>
<?php endforeach ?>
I would like in panel to specify Receipe-ID, but I don’t know how to pass that value (called code_call to filter by part i noted above with “HOW TO CALL RECEIPE ID”. Anyone helping me would make me a very happy person
Of course I thought something like this would work…
<?php foreach($site->index()->filterBy('receipeID', '*=', <?= $page->code_call()->html() ?>) as $item): ?>
<h2><?= $item->title()->html() ?></h2>
<?= $item->text()->kirbytext() ?>
<?php endforeach ?>
… what, of course, doesnt work