I have a query loop showing posts. On each result/post card I have a button that opens a popup template. I’d like to show some of the data from the post in the popup template. ( post title and some custom fields )
But as there seems to be no connection between the original post and the popup template then just using the field names as dynamic data doesn’t work ( just shows blank )
Thanks
If I understood your meaning correctly, you should add the template element in the query loop and select the desired pop-up in it. After that, DD tags will be displayed properly.
Many thanks!
I had read the academy that mentioned that, but it didn’t make a lot of sense to me so I just created an interaction on the button. This all worked except the popup didn’t know about the post.
you’re welcome, But personally, I am not very interested in doing this. Because it causes the value of DOM Elements of the page to increase a lot.
Suppose the DOM value is equal to 80 in the popup. You have 12 posts on the page that you want to display in the popup. Since you put the template element in the query loop, the number of DOM element pop-ups is repeated as many posts in the page. So in this case, the popup display for 12 posts adds 96 DOM to the page.
Thanks for the info. However for me it is not an issue.
I tend not to take much notice of all the metrics as I’ve found them unreliable in real life. So I just go by how the site performs for me.
In this case I’ve put at least 2 templates on every card in the loop and I have 2 loops on a page! But the number of cards in each loop is very low, 2 or 3 normally.
This was basically a proof of concept to see how I could allow users to manage fields in their posts.
While it all works perfectly it is a bit ungainly so I am looking at alternatives now, probably just a single page with all the fields to be managed in one place.
An interesting experiment but it has confirmed my view of popups … I don’t really like them at all. lol