First of all, thank you @nudinlubis for taking the time to test this and provide a working solution. I really appreciate it!
Your approach demonstrates the concept very well. However, I would love to have a more flexible solution that doesn’t require custom PHP for different data sources.
@Matej, thanks for your response! Here are some practical use cases I have in mind:
-
Accordion / FAQ component: Manually entered FAQs for a specific landing page or dynamically retrieved FAQs from a centralized FAQ CPT, filtered by category or relationship.
-
Card grid component: Manually curated cards or dynamically generated cards from different CPTs, such as services, products, projects, or team members.
-
Pricing card component: Manually configured pricing plans or dynamically retrieved plans from a dedicated CPT or WooCommerce products.
-
Slider component: Manually selected content or dynamically retrieved testimonials, references, or featured products.
In all these cases, I want to maintain a single component with the same structure, styling, and internal field connections, regardless of the data source.
Possible implementation
What if the existing Repeater Property could be extended with an optional “Query Loop” toggle, similar to the existing Query Loop functionality in Bricks?
-
Query Loop disabled: The Repeater Property works exactly as it does today. Users manually add and populate individual repeater items.
-
Query Loop enabled: Users configure a query using the existing Bricks query controls. Instead of adding individual items, they configure the repeater fields only once using the Dynamic Data Picker.
For example, for a card grid component, the repeater fields could be populated as follows:
Bricks would then automatically generate one repeater item for each query result, resolving the dynamic data in the context of that result.
The Dynamic Data Picker is already visible in the repeater fields, although it doesn’t seem to be functional there in the current beta. Perhaps this existing interface could be used for the field mapping without introducing a separate mapping UI.
Ideally, both the query and the field mapping could be configured at component instance level. This would allow the same card grid component to display services on one page, projects on another, and manually curated content on a third — without modifying the main component.
Why this would be valuable
-
Truly reusable, data-source-independent components.
-
No need to maintain separate manual and dynamic versions of the same component.
-
Centralized maintenance of structure and styling.
-
Flexibility to use different CPTs with different custom field structures.
-
No need for custom PHP adapters.
I think this would be a natural extension of the existing Repeater Property, combining three powerful features that Bricks already provides: Repeater Properties, Query Loops, and Dynamic Data.
The component would define how the content is displayed, while each component instance would define where the content comes from.
Would something like this be feasible within the current component architecture?