Title: Dynamic Content
Last modified: August 31, 2016

---

# Dynamic Content

 *  Resolved [streamworksaudio](https://wordpress.org/support/users/streamworksaudio/)
 * (@streamworksaudio)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/dynamic-content-11/)
 * Hi again,
 * Another question….
 * Is there a way to somehow filter the content of a popup’s content?
 * I would like to have a button with a popup class, but the contents of that popup
   I would like to dynamically change.
 * I was thinking this may somehow be possible by filtering the content of a popup.
 * Cheers
 * [https://wordpress.org/plugins/popup-maker/](https://wordpress.org/plugins/popup-maker/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/dynamic-content-11/#post-7052648)
 * [@streamworksaudio](https://wordpress.org/support/users/streamworksaudio/) – 
   Wouldn’t work the way you hope. Popup content is filter able during page load.
   But popups are rendered at that time not when the button is clicked.
 * What your after requires using JS to either pass variables from the button to
   Ajax or rerender the variable content using JS.
 * You can check out our Remote Content extension which has an API built in to allow
   you to quickly make an Ajax setup. You can set the data passed from the button
   to Ajax and define a php function to catch the response. We handle everything
   else. Whatever you echo in that php function will be shown in the popups. With
   that you can make one popup and dynamically generate content from hundreds of
   buttons.
 * Hope that helps.
 *  Thread Starter [streamworksaudio](https://wordpress.org/support/users/streamworksaudio/)
 * (@streamworksaudio)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/dynamic-content-11/#post-7052650)
 * I assume that the plugin uses AJAX to retrieve the ‘content’ from the post (popup
   post type)? And I assume that the CSS class then uses Javascript to render the
   AJAX response? This is a question just so I have a better idea of the plugins
   process.
 * With the Remote Content extension, would this then allow me to have the AJAX 
   call return whatever response from my custom function?
 * In other words… I create a blank Popup post (let’s give it an ID of 100). Then
   I create a button or link (or other clickable element) with the class of popup-
   100 -> this then (via Javascript) runs some AJAX that then runs a custom function
   and the response then populates the popup box?
 * Sorry for so many questions – I am just trying to see if this is possible. At
   the moment I am using a simple jQuery/PrettyPhoto plugin and with it I can pass
   some HTML (iframe etc), but I really just want to pull in the content of a post
   not a whole page that iframe would pull in.
 * Cheers
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/dynamic-content-11/#post-7052677)
 * [@streamworksaudio](https://wordpress.org/support/users/streamworksaudio/) – 
   Here is our doc on the feature for reference: [http://docs.wppopupmaker.com/article/33-remote-content-ajax-setup](http://docs.wppopupmaker.com/article/33-remote-content-ajax-setup).
 * You nailed it. You can do whatever you like in the AJAX php function, you can
   also pass additional info via JS. For example
 * You want full user profiles to appear in a popup in your member directory. So
   in your beforeAJAX JS you would add their member ID to the data array pulling
   it from the html wrapping the button.
 *     ```
       <div id="member-123" data-member-id="123">
           <button>View Profile</button>
       </div>
       ```
   
 * Pro Tip: So in this case you can also use Click Open Settings -> Extra Selectors
   to target your own selectors for clicking rather than adding the popmake-100 
   class to everything. In this case you could enter `[data-member-id] button` into
   the Extra Selector to target the profile button.
 * So your JS would look like this for the example given:
 *     ```
       $('#popmake-100').on('popmakeRcBeforeAjax', function () {
           var $trigger = $($.fn.popmake.last_open_trigger);
   
           $.fn.popmake.rc_user_args[100] = {
               member_id: $trigger.parent().data('member-id')
           };
       });
       ```
   
 * Hope that helps.
 *  Thread Starter [streamworksaudio](https://wordpress.org/support/users/streamworksaudio/)
 * (@streamworksaudio)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/dynamic-content-11/#post-7052762)
 * Hi Daniel,
 * Sorry for the delay. I will have a look into this further when I get some time.
 * But in a nutshell – if it is easy and painless to use the plugin and AJAX to 
   dynamically generate the content that populates a popup, then I would be interested.
 * Cheers
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/dynamic-content-11/#post-7052765)
 * [@streamworksaudio](https://wordpress.org/support/users/streamworksaudio/) – 
   AJAX and WP in general are rather simple but we are taking it even further to
   make Ajax content in Popups as simple as possible. So only 2 things your end 
   up having to do.
 * Tell it what data it needs to pass and then use the passed data to render content.
 * Hope that helps.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Dynamic Content’ is closed to new replies.

 * ![](https://ps.w.org/popup-maker/assets/icon-256x256.gif?rev=3097653)
 * [Popup Maker - Boost Sales, Conversions, Optins, Subscribers with the Ultimate WP Popup Builder](https://wordpress.org/plugins/popup-maker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/popup-maker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/popup-maker/)
 * [Active Topics](https://wordpress.org/support/plugin/popup-maker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/popup-maker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/popup-maker/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/dynamic-content-11/#post-7052765)
 * Status: resolved