Auto toggle text field with default value

Hello!
Since a few days I started playing around with Blueprints to override the default behavior of some fields in the admin panel.
I have successfully created a custom text field with a default value.
When I edit a page, the default value of “90” is inserted into the field “Latitude”:

Now when I save the page, the value is not written to the page header.
I think the problem is the missing tick in the checkbox next to the text field:

Currently my blueprint file looks like this:

extends@: item

form:
  fields:
    tabs:
      fields:
        options:
          fields:
            publishing:
              fields:
                header.latitude:
                  type: text
                  toggleable: true 
                  label: Latitude
                  default: 90
                  help: The Latitude of this Blog Item
                  placeholder: "For example: 53.75836740024965"
                  validate:
                    required: false
                    type: number
                    min: -90
                    max: 90

Is there any way to automatically set the tick of this checkbox?

Thanks a lot, Phillip

try other way… remove toggleable: true

and in your header twig check {% if header.latitude is not empty %} - do some stuff

hope this will help

1 Like

Hi,
your way works wonderfully - thank you!

Just for my interest: Can I address the checkbox in a blueprint?