Is it possible to create a page object from a uri-string in a plugin that extends fieldMethods. I want to preview in pagetable plugin the streetname of a specific client.
in my blueprint (with pagetable plugin)
columns:
myclient:
label: myclient
type: text
text : '{{ page.myclient.setAdres}}
// site/plugins/my-methods/index.php
Kirby::plugin('your/plugin', [
'fieldMethods' => [
'setAdres' =>function($field){
$klanturi=$field->value(); // clients/client1
$clientpage= page($klanturi);
return $clientpage->streetname(); // i get error $clientpage is null
}
]
]);
my error: Call to a member function streetname() on null