(Newbie) Bricks and ACF query questions

Hi everyone,

Brace yourselves for a very newbie question: I am working on a site that relies heavily on ACF custom post types. These post types have relationships with each another. Let’s say I have Products, Reviews and Experts.

I know how to display dynamic data fields for a specific product.

…but how do I display all the reviews and experts related to that specific product?

How can I do this in Bricks? With some kind of conditions? Or do I need to look at dependencies in ACF? Or use taxonomies?

I just don’t know where to start to research this. Any pointers are most welcome!

Thank you!

Hi @Sprnrml ,

As long as you connected the post types with ACF relationship field, you will be able to use Bricks Query loop to display them.

image

Then inside the loop, you can use dynamic tags ({post_title}, {post_id} and any custom fields) as you are currently in the related post context.

Regards,
Jenn

1 Like

Thanks @itchycode that’s it!!! Ihad already tried this, but kept using the wrong relationship, hence no results and quite some stress and frustration.
Thank you so much! Now I can finally move forward :slight_smile:

On a related note, when I connect expert A to expert B in the expert A post, how do I get the field to update in the expert B post automatically (so it shows that expert B is connected to expert A)? I tried bidirectional, but that didn’t work.

1 Like

@Sprnrml ,

Glad that helps.
Regarding the auto update related-post question, I would suggest you to check with ACF support :slight_smile:

Regards,
Jenn

Hi

to have the bidirectional connection updating automatically in both posts, you must enable the bidirectional setting on the Target Field field as well, pointing to the original field:

ACF CPT 1 with relationship field “Wein” with target “stammt von Chochete”:

ACF CPT 2 with relationship field “stammt von Chochete” with target “Wein”:

Cheers

Patric

Hi @Patric! Thanks so much for this. What I originally meant was that both experts/users are the same post type, so that they would share the same information, in the same field. But somehow, I don’t think that works automatically. So if I want to connect both users, I need to connect A to B in the first post, and B to A in the second one.