For the complete documentation index, see llms.txt. This page is also available as Markdown.

Displaying Binary Choice field

Binary choice field type, often represented by a checkbox or a pair of radio buttons with Yes/No labels, is suitable when you have a statement or question that can be answered with a binary (two-option) response.

Advanced Views natively supports the following binary types:

  1. ACF: any True/False field

  2. MetaBox: any Checkbox, Switch field

  3. Pods: any Boolean field

1. How to display a Binary Choice field

  1. Add any Binary choice field

  2. Save the Layout, copy its embedding shortcode

  3. Embed Layout: paste the shortcode inside the target place

By default, Advanced Views displays only a div with a choice-related class. You can customize the Layout template to use the render options:

2. Render options for Binary Choice field

2.1) Conditional usage

You can use the True/False field in any Twig conditions.

Displaying a label conditionally

Adding a class conditionally

2.2) Displaying check icon

In addition to conditional usage, the True/False field can be visually represented as a check or cross icon. This approach provides a clear, visual way to display binary information. For this example, we've used the UTF-8 check and cross icons:

Twig template:

CSS code:

Last updated