Looper Providing Multiple Post Data

Hi,

I am having trouble with a nested looper, which should be drawing dynamic content from an attachment.

In fact, I have two almost identical nested loopers. The first one works perfectly, but the second one is the one which is giving all data, rather than the data for the attachment in view. below is my structure:

Slide Container      Looper Provider                    DC     {{dc:acf:post_field field="mill_gallery"}}
Slide 1              Looper Consumer ALL
Caption              Looper Provider & Consumer ALL     QS     post_type=attachment&post_mime_type=image&p={{dc:looper:item}}
Text                 DC                                        {{dc:post:meta key="mill_caption"}}


Long text            Looper Provider                    DC     {{dc:acf:post_field field="mill_gallery"}}
DIV                  Looper Consumer ALL
Hidden DIV           Looper Provider & Consumer ALL     QS     post_type=attachment&post_mime_type=image&p={{dc:looper:item}}
Text                 DC                                        {{ acf.post_field({"field":"apc_long_text"}) }}

In the below screenshot you can see the output from both loopers. In the image, “1” refers to the output of the Slide Container looper and “2” refers to the output of the Long Text looper. In “2” only one bordered text block should be displaying - the one relevant to the image in the slider.

I have tried many different looper settings and positioning, but cannot get the Long Text looper to provide the correct output. Any ideas what I am doing wrong?

thanks,
Christopher

Hey Christopher,

You are using the incorrect dynamic content to display the long text. Please check out the demo I have created.

  • See the secure note

One thing to note that image 1 and 2, image 4 and 5 and the image 6 and 7, share the same long text description.

The structure my be looking like this:

Slide Container      Looper Provider                    DC     {{dc:acf:post_field field="mill_gallery"}}
	Slide 1              Looper Consumer ALL
		Caption              Looper Provider & Consumer ALL     QS     post_type=attachment&post_mime_type=image&p={{dc:looper:item}}
		Text                 DC                                        {{dc:post:meta key="mill_caption"}}


		Long text            
			DIV              
			Hidden DIV           Looper Provider & Consumer ALL     QS     post_type=attachment&post_mime_type=image&p={{dc:looper:item}}
			Text                 DC                                        {{dc:post:meta key="apc_long_text"}}

Kindly let us know how it goes.

Thank you @ruenel
I am away from my laptop this weekend, but will follow your kind instructions on Monday and report back. Many thanks!

Hello @whitemedia,

Please let us know how it goes.

Thanks

Hi @Ruenel,

Thank you. That all works. Also, yes some of the image do have the same long text.

Many thanks,
Christopher

Hi Christopher,

Glad that we are able to help you.

Thanks

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