Hello,
i’m using the SEO plugin for Kirby 4.
In the panel, I’m letting my user create pages. I would like to use a specific combination for the Metatemplate {{ page.title }} - {{ page.firstname }} {{ page.lastname }}
so that every new page created is already filled with this detail.
However, I can’t seem to be able to do it.
I feel the blueprint option could let me add a default value.
seo:
extends: seo/page
columns:
main:
fields:
metaTemplate:
default: {{ page.title }} - {{ page.firstname }} {{ page.lastname }}
But it doesn’t seem to be very flexible as the documentation stands these names could change…
I saw this page that let you, as I understood, define default value (?).
So far, this is not working, and I don’t understand why
php
<?php
// site/models/diploma.php
use Kirby\Cms\Page;
class TemplatePage extends Page
{
public function metaDefaults(string $lang = null): array
{
$content = $this->content($lang);
return [
// you can use field names (from blueprint)
'metaDescription' => "ping",
];
}
}
I admit I would like some enlightenment on that since I’m not understanding it really well…
Thanks a lot.