Looper provider / looper consumer issue

Hi there!

I am pulling my hair out over the following:

I have created a CPT ‘reviewer’ which contains all sorts of data on persons who review the content for blog posts. Think ‘name’, but also ‘profession’, ‘credentials’, etc.

There is also a CPT called organisations.

Reviewers and organisations are linked by an ACF repeater field, so that reviewers can belong to multiple organisations.

I have also added an ACF custom field to blog posts, so that each blog post can be linked to these reviewers (field type post object).

So, to summarize: a blog post has a field where a reviewer (post object) can be selected. Each reviewer has an organization repeater field where multiple organizations (post objects) can be selected that this reviewer belongs to.

Each organisation post type contains multiple fields for that organisation (name, description, url, etc).

So the relationships look like this:
Blog post
|
|_Reviewer
***|
***|_organisation
***|_organisation
***|
organisation
*******|_name
*******|_description

So here is my issue. For a particular blog post layout, I try to loop over the organisations that the reviewer for that post belongs to.

So I have a provider with dynamic content that selects the provider. In the consumer I have another provider for the organisations.

And there it breaks down.

I can extract the object ID’s of the organisations, so it seems to be working to a certain level.

See the screenshot below. Inside the consumer provider that shows the reviewer, there is another looper provider / looper consumer that loops over the organisations.

image

It is rendering the right post ID’s for the organisations. These post IDs (3783, 3793 and 3806 are generated using {{dc:looper:item}}

However, I cannot use any of my custom fields from these items? I was hoping something like {{dc:looper:field key="description"}} would work. But it doesn’t?

Please explain how I show the information that is contained in custom fields?

Hi Tristan,

Thanks for reaching out.
I have checked the given URL and found the first Looper is using the Dynamic Content through {{dc:acf:post_field field=“reviewer”}} which is present in the Post Reviewer group.

Whereas in the inner Looper Provider the Dynamic Content is {{dc:acf:post_field field=“alumni_of”}} which can’t be found within any of the group. Can you please specify to which group it belongs?
I would also suggest you go through the following article on ACF and Looper Provider which may help you on this.

https://theme.co/docs/acf-pro-and-loopers

Thanks

Hi,

Yes, the field ‘alumni_of’ is a repeater field in the ‘person details’ group.

As your screenshot shows, the ‘reviewer’ is a post object. the ‘alumni_of’ repeater field is there in that CPT.

I have added more text and screenshots to the /exemplar-post page that maybe better explain what I am trying to achieve and how.

And i did follow what’s on https://theme.co/docs/acf-pro-and-loopers but with post object CPT’s it gets a bit more complicated.

Hello Tristan,

Please check this documentation first:

And then, you need to watch this video tutorial:

By the way, we cannot log in to your site to check your looper settings. Please provide the WP login URL as well as your updated WP username and WP password.

Thank you.

Thanks, I have it fixed now! I had indeed overlooked something in the nested looper.

You are most welcome, Tristan!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.