Advanced Views Docs
Live PlaygroundDownload PluginGet PRO
  • 💡Help Centre
  • ⚡Getting Started
    • Introduction
      • Key Aspects
      • Creating Your First View
      • Creating Your First Card
      • Plugin Terms
      • Plugin Interface
        • Field Options
    • Installation
      • Advanced Views Lite
      • Advanced Views Pro
      • Comparison Table
      • Upgrading from Lite to Pro
    • Supported data vendors
    • Starter theme
  • 🌟Display Content
    • WordPress
      • Post
      • Taxonomy terms
      • User
      • Comments
      • Menus
    • WooCommerce Product
    • Meta fields
      • Basic fields
        • Number
      • Content fields
        • Image
        • File
        • WYSIWYG
        • oEmbed
        • Gallery
      • Choice fields
        • Select/checkbox/radio
        • True / False
      • Relationship fields
        • Link
        • Post_object
        • Page Link
        • Relationship
        • Taxonomy
        • User
      • Advanced fields
        • Google Map
        • Google Map Multiple Markers
        • ACF OpenStreetMap Field
        • Date/time picker
      • Layout fields
        • Group (Pro)
        • Repeater (Pro)
        • Flexible (Pro)
    • Object fields
    • Custom Data (Pro)
    • Custom Gutenberg Blocks (Pro)
    • Mount Points (Pro)
    • Front-end assets management (Pro)
  • 🦸‍♂️Query Content
    • Basic Filters
    • Meta Filters (Pro)
      • Current Post
      • Comparison
      • Dynamic Injection
    • Taxonomy Filters (Pro)
    • Pagination (Pro)
    • Custom Data (Pro)
  • 🏆Shortcode Attributes
    • Common Arguments
    • View Shortcode
    • Card Shortcode
  • 🧙‍♂️Templates
    • Customizing the Template
    • Template engines
      • Twig
      • Blade
    • CSS & JS
      • BEM Methodology
      • WordPress Interactivity API
    • File system storage
    • Pre-built components
    • Reusable components library (Pro)
    • Live reload
    • Multilingual
    • Custom Ajax & Rest API (Pro)
  • ☕Guides
    • Display Custom Post Type (CPT) on another post
    • Display Employees (CPT) of a Company (CPT)
    • Display Nested Repeater Fields
    • Map Marker from ACF Image
    • Display all CPT items on a single map
  • 🛠️Tools
    • Export/Import
    • Demo Import
    • Settings
    • Preview
  • 🏹Troubleshooting
    • Compatibility
    • Report a bug
    • Payment Issues
    • Lite Support (Forum)
    • Pro Support
  • ⚙️Customization
    • Filters and Hooks
      • View
      • Card
    • Suggest a feature
    • Performance
Powered by GitBook
On this page
  • About the field
  • ACF
  • MetaBox
  • Pods
  • Values delimiter
  • Getting all available options

Was this helpful?

  1. Display Content
  2. Meta fields
  3. Choice fields

Select/checkbox/radio

PreviousChoice fieldsNextTrue / False

Last updated 11 months ago

Was this helpful?

About the field

The select, checkbox, and radio field types allow editors to choose one or several items from a predefined list. Behind the scenes, all of them function similarly but offer different user interfaces for editors.

ACF

In ACF, the field is presented with select, checkbox, radio, and button group field types.

MetaBox

In MetaBox, the field is presented with checkbox list, radio, select, autocomplete, button group, image select, and advanced select field types.

Pods

In Pods, the field is presented as the Relationship field with the custom list option.

Values delimiter

Separate multiple values in the output with a delimiter.

Switch to the Field Options tab and fill out the Values delimiter.

Getting all available options

By default, the field's markup displays the title of the chosen option. The value is accessible under the '.value' property. You can also display the list of all options using the '.choices' property. This can be useful if you need to show a complete list or want to convert it into a form element.

Below is an example that demonstrates how to retrieve all the available information for a single select field. Similarly, you can work with a select field that allows choosing multiple options as well.

{% if select.value %}
    <div class="acf-view__select">
        <div class="acf-view__select-label">
            {{ select.label }}
        </div>
        <div class="acf-view__select-choice">
            <div class="acf-view__item">
                <div>
                    Chosen option title:
                </div>
                <div>
                    {{ select.title }}
                </div>
            </div>
            <div class="acf-view__item">
                <div>
                    Chosen option value:
                </div>
                <div>
                    {{ select.value }}
                </div>
            </div>
            <div class="acf-view__item">
                <div>
                    All available choices:
                </div>
                <div>
                    {% for choice_value, choice_title in select.choices %}
                        <p>
                            {{ choice_value }} : {{ choice_title}}
                        </p>
                    {% endfor %}
                </div>
            </div>
        </div>
    </div>
{% endif %}
🌟