List of protected words?

I keep finding I need to watch out which field names I use, because there are a bunch of words being used by the system - like ‘content’ (which I just stumbled across).

Also, there are unexpected things happening like fields called ‘image’ being converted to an image tag and fields called ‘date’ to a php date.

I feel like I stumble across these reserved words / exceptions to the rule every time I work on a template. It can be a little frustrating : )

Is there a list of protected words, which I should not be using for field names?

Check out this post: https://forum.getkirby.com/t/kirby-2-2-x-incompatible-with-legacy-field-names/2616/3;

Basically, you should mainly avoid all page methods (apart from date). As regards the others, you can use them, but you would have to use $page->content()->fieldname() to fetch the value of such a field.

Actually, using date as field name is allowed and useful.

Thanks!

I just want to reiterate that I find having to avoid all page method names quite exasperating as a user. is there something like page->fields->anythinggoeshere() ? If not, it might be an idea?

This special date feature is only useful if you know that it is going to happen. Otherwise it is surprising – which means spending 20 minutes finding out that this isn’t a bug. It is a feature! : )

As I mentioned above, you should be able to circumvent this problem by always using

$page->content()->your_field_name()

We have already put thisinto the docs here and here

Ahhh - I thought you were talking about how to make the ‘content’ field working… so in that case I would need to do:

$page->content()->content()

Thanks!