When you have two CPTs and there is a relatioship set between them, normally in the CPT1 single page, if you create a query block and you ask to present the {post_title}, having the relationship chosen, it should return the title of the reverse query but it doesn’t.
Here is an example…
Using ACF Pro i have a CPT named Faculty with many Professors (another CPT). This is a one to many relationship field i have in the Faculty fields group. Normaly if i set the query to the relationship and i diplay the {post_title} the reverse query should bring me all the faculties the professor belongs to, but it doens’t. It returns no results.
Here is a screenshot.
Hi @ysintos ,
The native relationship loop in Bricks is not supporting reverse query.
Based on the documentation, you will need to create a custom query by using Meta_query
Hence, I will mark this as “NO BUG”
Regards,
Jenn
How come it works with JetEngine ?
Hi @ysintos,
Different custom field plugins have their own way of handling relationships.
As per my understanding, ACF simply stores the relationship data in a metafield.
If you compare it with JetEngine, they have a separate relations page/manager to handle relationships. Additionally, JetEngine has some helper functions to retrieve the relationship results from child or parent, allowing Bricks to reuse the logic in the query loop. (Forgive me as I never tested to query relationship via reverse query in JetEngine yet)
Similarly, Metabox.io registers relationships separately and supports bidirectional relationships natively. They also provide API functions to easily retrieve the results.
Metabox.io Bi-directional Relationships Documentation
Metabox.io Getting Connected Items Documentation
I hope this explanation helps.
Regards,
Jenn
Thank you very much for all the support !!!