Hi,
I’d like to use the same blueprint for different kinds of articles - let’s say “Projects” and “Posts”.
90% of the fields are the same; I would like to handle the remaining 10% setting a different default value (they’re Select fields) according to the parent page UID (‘project’ or ‘post’).
In alternative, it’s ok to have different fields, but I wasn’t able to make the WHEN property works with a query statement:
date:
label: Data
type: date
default: today
width: 1/4
when: page.parent.uid = "posts"
This would make the site’s editors work a little bit easier.
You mean to set default values if no value is provided? That’s an option, although I’d personally prefer a page model that overwrites the writeContent method for this use case.
Won’t help with hiding/showing fields in your blueprint, though.
In the end, I’ll go with the page.create:after hook. So I can set a custom post_type field, and then using the WHEN property on the other fields that have to be hidden.
I’ve had some troubles though, because I guess the bnomei/autoid plugin use the same hook. I’ve disabled the plugin and everything went fine (sorry @bnomei, your plugin works like a charm in all the other cases).