<?php
use Kirby\Cms\App as Kirby;
use Kirby\Exception\Exception;
use Kirby\Http\Remote;
use Kirby\Data\Data;
use Kirby\Toolkit\Collection;
use Kirby\Blueprint\Blueprint;
Kirby::plugin('your-name/some-plugin', [
'pageMethods' => [
'getBlueprintFields' => function () {
$blueprintName = $this->content()->get('selected_blueprint')->value();
$blueprint = how can I get the blueprint??
$fields = $blueprint->fields();
$result = "Available fields:\n";
foreach ($fields as $name => $field) {
$result .= "- {{$name}}\n";
}
return $result;
},
]
]);
So basicly, I want to select a blueprint and then show all the field names in my Panel. This is in the index.php of my plugin folder. $blueprintName
is working. But how to select it a get the fields?
I don´t understand it, I tried all day long.