In this tutorial, I'm going to show you how you can create an Elementor Pro popup that's dynamically populated based on the element that was clicked.
This can be very useful when you don't want to create dozens of similar popups, and then have to update all of them if a layout or styling change is required.
Here, our popup becomes a template, and the data comes from a predefined array on your page. The data can also come from data attributes added to the popup opener elements.
Here is an example of what we will be creating. Scroll down to see a demo with buttons too.
The popup that shows up in the demo is always exactly the same. There is only one popup template on that page.
Features:
- Works for gallery pro, gallery basic, list icon, image carousel elements (with Array data)
- Also works for most other elements (with data attributes)
- Can swap images, texts and links
- Data comes from either an array on the page or data attributes on the clicked popup opener element (Don't worry that's well explained!)
Note that having Elementor Pro popups with dynamic content is already possible in the context of a single post template, for a single popup per post. If that's what you are looking for, then follow that tutorial instead.
And check the following if you want a dynamic popup with your Elementor Loop Grid or Loop Carousel..
This current tutorial is for when you need a list of items on your page, or several buttons or banners across your page, that will all open the same popup, but populated with different texts, images, and links.
Let's get started!
First, prepare your Elementor Pro Popup to be dynamic
This is a premium tutorial. Purchase access to unlock the full tutorial.
6 Responses
Hey Maxime!
I'm thinking of using this tutorial to create some team member popups. Because they aren't many I'm using them as single elements only. However, I was wondering if it's possible to open each popup by a custom URL? Or is this only possible with a loop grid as you suggested in your other tutorial?
Thanks, Lukas
Hey Lukas!
Add this code:
Add the code directly after the document.addEventListener('DOMContentLoaded', function () { line near the start.
And adjust the texts array as needed.
Cheers!
Wow, you're the best Maxime! That works perfectly!
Now there's just one more thing I'm not sure how to integrate... I'm using the popup trigger for single elements. As for the popup itself I'm using almost the same elements except that I would like to add an icon list (which in this case would be within the popup). So I'd need to address several items such as list-items and its links. Is there a way to integrate it or would I need to stick to single buttons in this case?
Thanks, Lukas
Hey Lukas!
Yes, the more complex your popup, the better you would be with my other tutorial.
This one here is made for more simple use cases...
Cheers!
Hmm I got you... it's just that it works really great for this particular use case. If I'd go with your other tutorial I would need to add a custom post type with ACF, which seems a bit over the top in this case as I've only got 4 static elements to use it for. So a workaround might be better here. In fact the only questionable element would be an e-mail-address, which ideally would be linked? So apart from a button, is there any other element, on which I could add a link to?
Hey Lukas!
Just add the email link to the button too... change the styling of the button if needed, for example, remove the padding completely, as well as background color and border, so that it's just a link, if that's what you need. Could be just the icon too...
I hope this helps!
Cheers!