Checkbox checked by default in Field Group
- This topic has 5 replies, 3 voices, and was last updated 3 years, 7 months ago by
Yasmine.
-
AuthorPosts
-
March 29, 2022 at 5:11 PM #35355
AnLip
ParticipantHi.
I have a Field Group for a CPT, one of it's fields is a "Checkbox List" (only one value) related to a Taxonomy (that decides if the CPT is to be listed on a grid on the frontpage, or not if unchecked). This the best way I have found to let the user decide in the backend if a poist is to be listed in his frontpage portfolio or not.So : I would like the checkbox to be checked by default everytime the user creates a new post. This way he can decide later to uncheck it to remove it from the frontpage. How ?
Thanks.
March 29, 2022 at 10:04 PM #35359Long Nguyen
ModeratorHi,
If you are using the Builder, just set the default value to checked by default. Screenshot https://monosnap.com/file/oXwN4AB26TBAVuQ0Vp34HZNPEy3lmf
March 29, 2022 at 10:11 PM #35361AnLip
ParticipantThanks Long. No my setup is different, I expressed badly : my field type is a "Taxonomy" with a "Field Type" of "Checkbox list".
If I tick the checkbox in the post edit page it will show in a grid querying the taxonomy associated. If the checkbox is not checked, then it will not appear on the grid.
I would like to know how to have this checkbox checked by default.Visible here : https://pasteboard.co/P7I7swREVXOH.png
March 30, 2022 at 11:24 AM #35368Long Nguyen
ModeratorHi,
There is no option to set the default value for the field type
taxonomy, but you can use the custom settingstdfor this field in the Advanced tab and assign it to the term ID. Screenshot https://imgur.com/p2kQdKx
Read more on the documentation https://docs.metabox.io/field-settings/#generalMarch 30, 2022 at 4:10 PM #35371AnLip
ParticipantThanks Long. That worked.
Note for others : the value "3" on the screen capture you linked to, must correspond to the ID of the taxonomy's value ("Yes" in my case).
For the record : I finally decided to create two "Radio list" values for the taxonomy ("Visible") : "Yes" and "No". The portfolio grid on the welcome page queries all posts that have the "Yes" taxonomy value. This way the client can decide if the post will show on the Home page of his website.
April 1, 2022 at 6:27 PM #35408Yasmine
ParticipantJust wishing to ask more on this question..
Are you able to set the "std" as a conditional value based on the value from another list? So for example if they were to choose Paris from question 1 then the suggested STD would be France ? And if this is possible - how do you set it up?
-
AuthorPosts
- You must be logged in to reply to this topic.