How to Create a Dynamic Table with ACPT and Bricks Extras

  • ACPT

In this tutorial, you'll learn how to create a dynamic table using ACPT plugin alongside the Dynamic Table element in Bricks Extras

Tutorial Requirement

  1. ACPT Plugin
  2. Bricks Extra ( Dynamic Table Element )

Activating Dynamic Table Element

Ensure that the BricksExtra Dynamic element is activated. If it’s not, and you want to enable the Dynamic Table element in BricksExtras, navigate to Bricks > BricksExtras > Elements > Dynamic Table.

Screenshot of BricksExtras Settings page showing a list of enabled elements/features like Toggle, Tooltip, and Dynamic Table. The interface includes options for documentation and grouping.

Creating Custom Post Type

In this tutorial, we will create a custom post type called ‘eBooks,’ where we will store information about our eBooks. Then, we will populate this data in the dynamic table. If you’re not familiar with creating a custom post type, be sure to read ‘How to Create a Custom Field Using ACPT’.

Screenshot of a WordPress dashboard showing registered custom post types. An "ebooks" type is highlighted with options to view, edit, delete, export code, and set permissions.

Creating Custom Fields

We need to create custom fields that store our data, such as the book summary, published year, and number of pages. Therefore, we have created these custom fields, and Our metabox is named ‘ebooks-metabox.’

Screenshot of a WordPress admin dashboard showing the ACPT plugin interface for managing ebook metadata fields such as summary, year published, and pages.

Adding content to our eBooks custom post

We’ve added three books to our eBook custom post type.

Admin dashboard showing a list of three ebook posts: "Paycheck to Paycheck," "Chasing Caitlyn," and "The Complete Works of William Shakespeare," with options to edit or apply bulk actions.

We add content to our custom fields as needed to ensure each book has the necessary information and data for the dynamic table display.

Screenshot of the WordPress backend for editing an ebook page titled "Paycheck to Paycheck," with meta box, excerpt, and featured image shown.

Displaying the data on the frontend

Now that we have populated each field of our books, we need to display this data on the frontend in a table using the BricksExtra dynamic table. You can either create a page or use it within a template, depending on your use case. However, I am using a page.

Screenshot of a webpage showing a design interface with a text container labeled "Foodiesland" at the top and various editing tools visible.

To add an element, navigate to the top bar and click on the ‘+’ sign, then scroll down until you find the dynamic table.

A computer screen displays a user interface for setting dynamic options with a query loop. An arrow points to "Populate rows with query loop" in the menu.

We need to enable this feature for the dynamic row to populate correctly.

A interface showing a dropdown menu with options like Posts, Pages, Media, and Ebook, highlighted by a red arrow and cursor.

After enabling the feature to populate the rows using a query, the next step is to specify which post type you want to query. In this instance, we will be querying our eBook Custom Post Type, so make sure to select the right option.

A website interface displaying column settings on the left, with an "Add Columns" button and options. On the right, a gallery of images with pagination controls below.

then, it’s time to add your column and cell data. For the column heading, you can use a static value, but feel free to use a dynamic value if that suits your needs better.

The cell data will display the information for that column. Since we’ve used the WordPress native featured image of our custom post to upload the book cover, we can use the following dynamic data {feature_image} in the cell data to fetch the featured image.

Image of a interface showing a column settings panel on the left and a book list with "Foodland," "Psychedelic Psychsok," "Chasing Caelyn," and "The Complete Works of William Meadows" on the right.

We should also insert a column for the book title in our table. As we’ve used the post title as the book name, we will use {post_title} in the cell data to retrieve the book title.

Spreadsheet showing three book titles: "Paycheck to Paycheck" (2000), "Chasing Caitlyn" (1890), "The Complete Works of William Shakespeare" (1990). Showing 1 to 3 of 3 results.

In this step, we will add another column that displays the year each book was published. To do this, we will query the custom field we created earlier, which stores the publication year for each book. This field is represented as {acpt_ebooks_ebooks-metabox_year-published}

A user edits a column heading for a table displaying book titles, publication years, and page numbers within an interface design tool.

The final column is to display the page numbers of the book, which are stored in another custom field we created to record the book’s page numbers. We will use {acpt_ebooks_ebooks-metabox_pages} for this purpose. and save it then preview the page.

A table displaying book titles with their corresponding images, published years, and page counts. Titles include "Paycheck to Paycheck," "Chasing Caitlyn," and "The Complete Works of William Shakespeare.

If you’ve correctly linked the columns to the respective cell data, the outcome will be as follows. You will see each column displaying its corresponding values accurately. This means that each column will be populated with the data we’ve specified, ensuring that all information is organized and easily accessible.

ACPT Version :

LogoCreated with Sketch.

Bricks Version :

If you haven't purchased ACPT yet and are planning to, we'd appreciate it if you use our affiliate link. It costs you nothing extra and helps us continue to deliver quality content.