Hello,
I have a custom block on which I want to apply a custom block method.
This method should allow me to create virtual pages from the block images.
Things seem to work pretty well : each image is associated to a Page object.
My problem : the url of the virtual page takes me to an error template and not the template I gave it in the Page::factory.
What I’m missing? v_V
Kirby::plugin('my/block-methods', [
'blockMethods' => [
'recupPagesVirtuelles' => function () {
[...I get a $images array with my images ...]
foreach ($images as $image) {
$tab[] = [
'slug' => $image->name(),
'template' => 'gallery-image',
'model' => 'gallery-image',
'dirname' => $this->dirname(),
];
}
return Pages::factory($tab, $this->parent());
}
]
]);