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 type
  • How to use it
  • Displaying items as a list
  • Displaying items as a Grid

Was this helpful?

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

Flexible (Pro)

PreviousRepeater (Pro)NextObject fields

Last updated 1 month ago

Was this helpful?

The is a unique ACF field type that is not available in other meta vendors. It provides a versatile, block-based editor, allowing for structured content creation.

With the Flexible Content field, you can define multiple layouts and sub-fields within a single field, giving you complete control over the content structure. Editors can easily choose and arrange these layouts within the editor interface.

About the field type

The Flexible Content field extends beyond traditional group and repeater fields, allowing for the creation of multiple groups of fields within a single flexible field. Editors can select the desired groups directly within the editor.

Consider a scenario with a 'Cars' Custom Post Type (CPT) consisting of three sections: pricing, dealers, and reviews. In the conventional approach, three separate field groups would be added, limiting the editor's ability to repeat sections or control their order on specific pages, resulting in a static layout.

By employing the flexible field, editors gain greater flexibility. For instance, a 'Car' flexible field could be created with the aforementioned three layouts (groups). Each layout functions like a group, with its own set of fields. This flexible field is then attached to the 'Cars' CPT, enabling editors to freely choose the order of sections and repeat them as needed. For example, they can arrange sections as reviews, pricing, reviews, or any other desired structure.

How to use it

To display a flexible field, follow these steps:

a) Create a new View ('Primary'):

  1. On the Fields tab, click the 'Add field' button.

  2. Choose the flexible field.

  3. After selecting the flexible field, you'll see a new 'Sub-fields' tab appear in the row. Click on it.

  4. Select all the layouts you want to display.

  5. Save the current View.

b) Create a new View ('Internal'):

  1. On the Fields tab, choose your group in the 'parent group' field.

  2. In the parent field, select the 'flexible layout' from the previous step.

  3. Click the 'Add field' button and add all the layout fields you want to display.

  4. Save the current View.

c) Amend the 'Primary' View:

  1. Find the 'flexible' field in the fields list.

  2. Open the 'Sub-fields' tab and locate the target 'layout'.

  3. Fill out the "View" setting by choosing the 'Internal' View.

  4. Save the current View.

You're done! Now you can copy the shortcode of the 'Primary' View and paste it into the target location.

Advanced Views will automatically retrieve the set of chosen layouts on the page and pass the data of every layout to the specific View defined for each layout. This process occurs dynamically, granting editors the freedom to customize content without manual intervention.

Displaying items as a list

#view__flexible-content {
display: flex;
gap: 10px;
}

Displaying items as a Grid

#view__flexible-content {
 display: grid;
 grid-template-columns: 1fr;
 gap: 20px;
 }

@media screen and (min-width:992px) {
 #view__flexible-content {
  grid-template-columns: repeat(4, 1fr);
 }
}

To display all the items in a single row, you can use the CSS :

To display all the items as a grid, you can use the :

🌟
Flexible Content field
Flexbox
CSS Grid