Jump to content

Checkbox field checked by default?


prestoav
 Share

Recommended Posts

The problem with default yes is that it would not affect already existing items. So if you had 100 pages already, then you add a checkbox with default=1 and you add another 200 pages and then you use a selector "mycheckbox=1" then it would find 100 pages, not 200.

Or you'd have to update all 100 pages that already existed before you added the checkbox.

Ryan recommended once (if I remember correctly) to use what I'd call the reverse-label-pattern. So instead of showing a checkbox "send email after save" that is default on, you'd add a checkbox that is default off and shows "do NOT send an email after save". Or "no mail after send" or whatever.

Or you add a hook on page create that populates the checkbox for you.

Or you add a toggle field, that has the option to set default yes/no etc.

I think I'd probably use a nice, non-reversed label together with a hook to auto-populate when the page is created.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   1 member

×
×
  • Create New...