Dynamic Content - child access parent information?

I have a modal that contains an image block and a text block. I would love to link the image block to the parent modal’s toggle image. Is there any way to do this through Dynamic Content?

Section 1
 -Row 1
 - -Column 1
 - - -Modal 1
 - - - -Image 1
 - - - -Text 1

I.e. set the image source of Image 1 to Modal 1’s Toggle Image property?

Hello @horowitzio,

Thanks for writing in! You can use the Image type in your Modal > Toggle settings so that you can use the image source of Image 1 as the Modal’s Toggle image.

Hope this makes sense.

Once I set the Modal > Toggle to Graphic, how do I link the Toggle’s Primary Graphic Image source to the Image 1 source?

Hey @horowitzio,

Is your Image 1 source a featured image or dynamic content? You can use that same code in the Toggle’s Primary Graphic Image source. Wait, are you trying to use the Modal element as an image ligthbox? It might not be possible. Can we check your element settings? You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

In this specific instance I was trying to create a grid of popups for staff bios. So, click on photo, modal pops up with same photo and text for bio. But there are other instances on the page where I’d love to be able to access parent properties in a child element programmatically.

Hello @horowitzio,

You will have to use Loopers in your element structure like this:

Section 1
 - Row 1 => Looper Provider (this might not be needed in custom single layout)
 - - Column => Looper Consumer
 - - - Modal 1
 - - - - Image 1
 - - - - Text 1

Hope this makes sense.

It is a little convoluted, but it does make sense.

Hi @horowitzio,

Glad that it makes sense to you. Please let me know if you need any further help.

Thanks

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