I’m trying to get a page tabs definition of a page blueprint using php for a plugin I’m developing:
However, I’m getting this incomplete blueprint, which makes sense because it’s a lazy-loaded php-based blueprint (cookbook).
// getting a specific tab of a page blueprint
$value = $newPage->blueprint()->tab("dynamic");
// $value
[
{
"columns":[],
"icon":null,
"label":"Dynamic",
"link":"\/pages\/projects+myproject\/?tab=dynamic", // api link to load
"name":"dynamic"
}
];
The question is, how do I fetch the blueprint of this specific php-based tab?
I tried hacking the Panel Fiber request, but I’m getting an empty object:
I would guess it’s an authentification issue?
// Set Fiber Header
$_SERVER['HTTP_X_FIBER'] = 'true';
// new App Instance
$app = kirby()->clone([
'request' => [
'method' => 'GET',
'url' => '/pages/projects+myproject',
]
], true);
// Request
$value = Panel::router('/pages/projects+myproject');
unset($_SERVER['HTTP_X_FIBER']);
// $value
{}
Is there a simpler way?