Hi all -
I’m trying to fetch text from a text field called ‘code’ but haveing trouble. ‘page.title’ works but not page.fieldname. Below is the section being called from site.yml - anyone know what I’m doing wrong?
type: pages headline: Products parent: kirby.page("products") info: "{{ page.code }}" template: product
code field is reserved by Kirby. Try using another name like productCode
code
productCode
You can also fetch the content from that field via
$page->content()->code()
.i.e. using the additional content() method, instead of renaming the field. In general, it’s easier if you prevent native methods in field names.
content()
Argh thanks so much, that’s all it was! Should have checked that, thanks a bunch!