Blueprint field hidden with default

Hallo,

there are no field properties in the reference of the hidden field. Is that correct? If so, is there a way to store a default value in the hidden field?

Lule

Yes, you can set a default value:

iamhidden:
  type: hidden
  default: blue

Note that defaults only work on page creation, they do not affect existing pages.

2 Likes

Thanks a lot. Solved.

I tried and I failed. Then I tested a little. There seems to be that true is saved as 1 and false is not saved or β€˜β€™ is saved.

I don’t know if this is a bug or a feature. But as long as true and false are saved as strings in other fields like toggle or radio there is a problem of data integrity at least IMHO.

That helped, but you also should add this information to your reference (https://getkirby.com/docs/reference/panel/fields/hidden).
It took a me a time to find out that hidden fields do not affect existing pages. Thanks :slight_smile: