Hello everyone,
I have a template file where i need to pull a specific page . So i use
$category = $site->index()->findBy('acronym', $currentPage->categorie()->value());
When i debug the $category variable, all is ok
object(Kirby\Cms\Page)#509 (15) {
["children"]=>
object(Kirby\Cms\Pages)#517 (0) {
}
["content"]=>
object(Kirby\Cms\Content)#602 (3) {
["title"]=>
string(21) "Formation courte (FC)"
["acronym"]=>
string(2) "FC"
["autoid"]=>
string(8) "chr9ax9x"
}
["files"]=>
object(Kirby\Cms\Files)#676 (0) {
}
["id"]=>
string(12) "categorie/fc"
["mediaUrl"]=>
string(35) "//localhost:3000/media/pages/categorie/fc"
["mediaRoot"]=>
string(37) "/application/media/pages/categorie/fc"
["num"]=>
NULL
["parent"]=>
string(9) "categorie"
["slug"]=>
string(2) "fc"
["template"]=>
object(Kirby\Cms\Template)#678 (3) {
["name":protected]=>
string(7) "default"
["type":protected]=>
string(4) "html"
["defaultType":protected]=>
string(4) "html"
}
["translations"]=>
object(Kirby\Cms\Collection)#599 (2) {
[0]=>
string(2) "en"
[1]=>
string(2) "fr"
}
["uid"]=>
string(2) "fc"
["uri"]=>
string(12) "categorie/fc"
["url"]=>
string(23) "//localhost:3000/categorie/fc"
["siblings"]=>
object(Kirby\Cms\Pages)#507 (4) {
[0]=>
string(13) "categorie/cas"
[1]=>
string(13) "categorie/das"
[2]=>
string(12) "categorie/fc"
[3]=>
string(13) "categorie/mas"
}
}
But i if try to access a field, il got an error
var_dump($category->title());
// error : Call to a member function title() on null
Thanks in advance