Accordion Grid Query Loop in Bricks

Accordion Grid Query Loop in Bricks

This Pro tutorial provides the steps to set up a query loop on a nestable accordion element in Bricks such that the "titles" are arranged in a grid with the corresponding content (panels) opening below the clicked title either taking up the container width or going edge to edge.

We shall also add a working close icon for the panels.

Use Case: Show team member cards with member info neatly expanding when the headshot + name is clicked.

Since a standard nestable accordion element is being used with a query loop, we have full control w.r.t what info appears before and after the accordion items expand. In the screenshot below, several custom field values that are set up with ACF are being shown.

Sample demo of content in the container width:

Sample demo with edge to edge content:

Step 1

Edit your Page/template with Bricks.

Step 2

Container width

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 524 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
ACF Post Object Query Loop inside a Posts Query Loop in Bricks

ACF Post Object Query Loop inside a Posts Query Loop in Bricks

How to loop through a CPT and within each post, output a list of related posts.
Categories:
How to List Your Posts Divided by Categories in Bricks

How to List Your Posts Divided by Categories in Bricks

In this tutorial, we'll learn how to display a list of posts divided by each category. The DOM tree Here is how I structured my…
Categories:
Pro
Query Loop Index in Bricks

Query Loop Index in Bricks

This Pro tutorial provides the code for getting the index of each post in Bricks' query loops. This can be used for either outputting the…
Categories:
Pro
Parent post Bricks query loop

Parent post Bricks query loop

Updated on 5 Feb 2024 In the BricksLabs Facebook group a user asks: Is there a way to output the data of a parent post…
Categories:
Pro
Inserting Random Ad Between Posts in Bricks

Inserting Random Ad Between Posts in Bricks

How to insert random ads (post type) in between regular posts on the blog page.
Categories: