It seems like an easy topic, but what ever I tried I am not able to set a custom image for a page cover in the panel. Setting a custom icon is easy or getting the first image. But how can a set a specific image, let’s say like:
Thanks for the quick response. Unfortunatley I am kind of confused now. The documentation of the page model is dealing with the possibility to extend a page in order wo access custom functions in my templates. Not sure, if this is what I am looking for.
My goal is to give “Schaukasten”, “QR Code Galerie”, etc. a custom image in the panel.
Following your advice I added a “schaukasten.php” to the models folder (site/models).
The code of the schaukasten.php currently looks like this:
<?php
class ProjectPage extends Page {
public function getAsset()
{
return Asset('assets/images/background.png');
}
// all methods of the Page class are inherited and can be overridden here now.
}
And the corresponding schaukasten.yml - blueprint like this:
You need to have this custom model method in the model of the pages in the stationen section (assuming here that Schaukasten, QR-Code Galerie and Dachgeschoss all use the same blueprint). The model must have the name of these children blueprints. So if schaukasten etc. use the schaukasten blueprint, your page model must be called SchaukastenPage, not ProjectPage.