Good day everyone, new day new question
My client wishes a centralized file folder, this way I made a “Datenbank” folder, each file there it has a page with database.file template. The page structure looks like this (Folder name and template)
- ...
- 04-Unsere Schule
- 05-Downloads
- Datenbank (database)
┕ Schulanmeldung (database.file)
┕ Datenschutzblatt (database.file)
┕ Stundenplan (database.file)
┕ ...
The database
template has a Kirby 3.7 introduced table page layout and nothing more, it works excellent.
In Datenbank only subpages with template database.file
can be added. Every such file has an identification code in a field, it looks like this:
documentIdentifierCode:
label: Dokument ID
type: text
Now, the idea is to “call” this file with information like title, download URL etc. via a custom block, I made this fieldset for that block, that looks like this:
card.file:
name: Dokument ID
fields:
transfercode:
label: Dokument ID
type: text
The block snippet looks like this:
<?php
$transfercode = $block->transfercode();
$items = page('Datenbank')->children()->filterBy('template', 'database.file')->filterBy('documentIdentifierCode', '==', $transfercode);
foreach($items as $item): ?>
<?= $item()->title() ?>
...
<?php endforeach ?>
Unfortunately it doesn’t display anything when using the stuff i wrote above. Can you please help me troubleshoot this issue.
Another thing, would it be possible to show inside a blueprint the title of file being called? More exactly here instead of text “Dateiabruf”: