By default, this boolean field type will return "Yes" or "No" (translated to the language the site/section is). But perhaps you'd want to have different text for that. This is possible for both view and form. The key values to use are "yes_value" and "no_value", like so:
"availableForWork" => [ "type" => "Boolean", "label" => t("Are you available for work"), "config" => [ "yes_value" => t("Yes!"), "no_value" => t("No.."), ], "view" => [ "yes_value" => t("Oh yes, I am"), "no_value" => t("Currently not"), ], ],
The values accept a string only.
Want to pre-populate your field with a value? Let's say you want it to set to "no" by default. It's as easy as putting that into the config. Accepted values are: true, false, 1, 0, "1", and "0". By default, no value is selected.
"availableForWork" => [ "type" => "Boolean", "label" => t("Are you available for work"), "config" => [ "default_value" => false, "yes_value" => t("Yes!"), "no_value" => t("No.."), ] ],
Use, by you or one client, in a single end product. The total price includes the item price and a buyer fee.
Use, by you or a client, in 5 single end products. The total price includes the item price and a buyer fee.
Use, by you or a client, in x/xx single end products.
Upon request, quote will be made and sent to you via email.
Got something to say? Need help?
View support forum