Yannick's Corner

WordPress Plugins, Plugin Development Cookbook and random thoughts

Modal Dialog


Create simple pop-up dialogs

This plugin allows users to add a pop-up dialog to their site on all pages or specific pages, that can appear once or multiple times. The dialog can contain content defined in the admin pages or content from an external web address.

You should normally see an example of the plugin’s capabilities while viewing this page.

Donations

If you feel generous and really like this plugin, here is a donation link on Paypal. You can edit the amount before proceeding with the donation.

PayPal-Donate-Button-PNG-HD

423 thoughts on “Modal Dialog

  1. Thanks for this great plugin Yannick!

    Yannick , I have an issue.. I am trying to display the dialog on a specific page.
    I have checked “Only show on specific pages” and in “Pages to display Modal Dialog” I entered the page ID as just “1,4” (this is my testing blog) but the dialog doesn;t appear on both the pages 😦
    Is it a known bug or I am doing something wrong!

    Like

    1. Hi Keshav, Please try again with the latest version that I just released yesterday. There was indeed a problem with the page restriction check.

      Like

  2. hi
    Yannick Lefebvre

    first of all thanks for amazing plugin ….its really helpful for me
    i am using this plugin for my sites…
    but now i find some problem , on day Frank McClung November 18, 2010 at 4:18 am commented on your blog the same problem facing now.. i am beginner type guy in php so please describe how to solve this re-size problem ….??

    Like

    1. Hi Engiguide. Which issue are you referring to? I just tested the sizing options and it worked perfectly. I also fixed the problem with Modal Dialog not supporting posts before that Frank reported.

      Like

  3. Hi,
    How can we restrict the pop up to appear only on specific pages within the site?
    I’ve tryed to put the URLs in the ‘Pages to display Modal Dialog (empty for all, comma-separated IDs)’ option but with no luck.
    Please help as this plugin seems to be the solution to one big problem I had.

    Thanks

    Like

    1. Hi Carlos, Can you check again with the latest version of Modal Dialog? There was a problem with the page check code that I corrected yesterday. If it still does not work, I would need the address of the site where you are trying to use the plugin.

      Like

  4. Hi there,

    I’ve been looking for an existing solution for displaying a “first visit” message, rather than trying to create my own from scratch. The problem I have is that they all are either cookie or IP based, when I want it to be *user* based. My site requires people be registered in order to see the content, so it would make sense to only display the message the first time that user ever logs in. After that, the DB will have a record that they had visited and they will never see the message again, regardless of browser, cookies, IP address, or anything else.

    What about adding such a function to Modal Dialog? Also I agree with another’s comment about wanting a way to easily reset the visits or simulate a first visit. Having to delete cookies is not always acceptable because we lose other states such as logins, etc which could make our test impossible.

    Thanks… please email me if you would like to discuss adding this feature, I may even be able to do it myself possibly with guidance from you.

    Jonathan

    Like

    1. Hi Jonathan. I just released a new version of Modal Dialog to add a button to delete cookies created by Modal Dialog easily for the site instead of digging into the cookies manually. Now, as for your main question, I am not too sure how Modal dialog could be adapted to handle display of the dialog on a per user basis. I will think about it and get back to you. It would add a lot more complexity to the plugin but might still be an interesting enhancement.

      Like

  5. Yannick, I really appreciate the work you’ve put into this plugin. I do have one question though, does it only work for pages and not posts? I tried to enter post IDs and it would not work. What would I need to do to modify the code for posts too? Please advise.

    Like

    1. I’d be more than happy to make a donation if you can get it to work on posts if it does not already.

      Like

      1. Hi Frank. I just released version 1.2.1 of Modal Dialog to add the possibility to get it to work with posts.

        Like

      2. Yannick, even with the latest update the modal dialog only works with pages but not both pages and posts.

        Like

  6. Ciao Yannick,
    I’m trying to find a way to display a different Modal dialog for different pages.
    I’ve a site with different product pages and I need one dialog for each.

    THX a lot

    Mauri

    Like

    1. Hi Mauri,

      This was not possible in previous versions of Modal Dialog, but I just released version 2.0 to include this functionality.

      Download the latest version and let me know if you have any issues with this new mechanism.

      Like

  7. Hi there. I really like this plugin, but I have a question for you. Does it work with all browsers? When I have been “testing it” sometimes it doesn’t come up on some of the different browser types. I have it set to show up 1x per session on any of my pages (including home). Any thoughts?

    Like

    1. Hi Nichole, It should work on most recent browsers (IE 6+, Firefox, Chrome). Which browser is giving you a hard time?

      Like

    1. Hi Matt, You can make the popup active and only showing up on a specific page on your site that you would keep private. This would allow you to configure it until it’s ready to go. I have investigated creating a preview button but did not find a way to do it.

      Like

    1. Hi Akin, Are these elements that are showing above the dialog using any kind of special layer priority CSS codes?

      Like

    1. Can you give me a link to the site where it’s not working right so I can take a look and try to determine why?

      Like

      1. Hi PLC,

        You have conflicting versions of jQuery on your web page. Including Modal Dialog, you have 3 different versions of jQuery that are conflicting with each other. Please try removing the following lines from your theme’s header template and see is that helps:

        Like

      2. Hi PLC, it looks to me like you removed Modal Dialog from your site. Let me know if you still want me to help you on this.

        Like

  8. Hi Yannick

    Thanks for the awesome plug-in, it really has helped on several websites that I run for promotional items and newsletters etc.

    I am sure you are getting tired of ALL the questions, but….
    My question is whether it would be hard to create a button to activate one of these boxes. For example I am creating a “Staff” page for a website I am creating, and I would love for someone to click on an image of the CEO and get his full bio in a modal box. Is this easily doable with your plugin or should I look into getting someone to custom code it?

    Many many thanks, and even if this is not resolvable, your plugin has already more than earned a place in my favorites!

    Regards
    Judah

    Like

    1. Hi Judah. Modal Dialog would not quite be usable for a single staff page that would have a list of all of your staff. It would need to be custom done. That being said, it would be a fairly easy thing to put in place.

      Like

      1. Yannick,

        Thanks for getting back to me so quickly, and thanks for the tip.

        I’ll have to figure out another route, but your plugin is still extremely handy!

        Judah

        Like

  9. Hi Yannick, great plugin !

    In order to reduce bounce rates on posts, I’m trying to trigger the pop after 5 seconds after the page load. So far no luck. Can you please give us any tip regarding this issue. Thanks.

    Like

    1. Hi Ivee, What value are you setting for the appearance delay? It should be 5000 if you want it to show up after 5 seconds.

      Like

    1. Hi Mariah,

      The problem is that your theme is loading it’s own copy of jQuery after the WordPress copy has been loaded and Modal Dialog has initialized. This causes all jQuery work up to that point to be discarded. This line is probably in your theme’s header file.

      Like

  10. Hello Yannick,

    First of all, thank you so much for this great plug-in. Really appreciate you work.

    I have one issue with this plugin. I want to popup an image and configured it to show the url of the gif file.

    However, the dialog width and heights seem not to work on my end. I try to manually entering the pixel size of the gif image, doesn’t work. I try the option Auto-Size, no luck either.

    No matter what I tried, the popup dialog size seems to remain the same size.

    Do you have any suggestions?

    Thanks in advance for your kind help.

    Regards,
    Mehmet

    Like

    1. Hi Mehmet, As outlined in a personal e-mail thread, the conflict is that you are using a plugin called “Fancybox for WordPress” that uses an older version of fancybox than the one that Modal dialog uses. You need to contact that plugin’s author to request that he update his plugin to a newer version. I am using version 1.3.1 in Modal dialog.

      Like

    1. Hi Gustavo,

      Thanks for the comment. Turns out that the code that I put in a comment to explain to someone what was broken on their site broke my site! 🙂 It is fixed now.

      Like

  11. Hi Yannick,

    first of all I would like to thank you for making this great plugin possible. But for some reason, the window is not showing. wp-head and wp-footer are included and I do use other jQuery as well (for other plugins which I still need). Can you give some pointers of what the problem might be?

    Cheers

    Like

    1. Hi Paul, I see that you have another dialog showing up on your site. I guess you moved on to another plugin?

      Like

  12. Hi Yannick,

    I’m echoing everyone else’s sentiment here: “First of all, great job. But…”

    This is the third popup plugin I’ve tried today after the first one I had planned to use for a campaign crapped out. So far, it’s the only one that has successfully popped up. However, now I can’t close it!

    The close button does not work, and changing the “Dialog close method” to “Anywhere” doesn’t make any difference. I’ve tried hiding the button, showing the button, doing a little dance, yelling at the internets… no luck.

    Any insight? Btw – I do not know any javascript. Just HTML, CSS and a touch of PHP. So… speak to me as you would speak to a stapler.

    Kind regards,
    Ned

    PS – Tried it in Chrome, IE and FF. Friend tried Safari. Same situation in all. My site is http://www.SheepsheadBites.com. The popup is currently deactivated.

    Like

    1. Hi Ned,

      There is most likely a conflict between the javascript used by Modal Library and other scripts loaded on your site. That being said, I would need the Modal Dialog plugin to be reactivated to be able to see why it’s not working. Please contact me back when you have it up and running and I will look at it quickly.

      Like

  13. Hello Yannick!
    I’m hoping your plugin will do what I need, but now that I have it all installed and configured, nothing pops up! I’ve checked my template header and there are scripts in place for elements I need to keep. Is there any way to make it work? Thanks!

    Like

    1. Hi Kayla, It looks like the Modal Dialog code is not appearing in your footer. Can you check inside of the footer.php file in your theme to see if the wp_footer(); function is present? If not, add it to the footer and Modal Dialog should then work as expected.

      Like

  14. First of all, props for your great work ! Modal-dialog is a great plugin !
    It is also works well with WP-Minify, which is vital for WordPress performance

    I have a question and a performance tip:

    question: how come the line:
    echo “#fancybox-img {-ms-interpolation-mode: bicubic;}n”;
    ‘was removed in the latest version of modal-dialog.php ?

    performance tip 1:
    remove the IE-specific CSS from modal-dialog.php and append it in the general stylesheet (better performance with YSlow and PageSpeed)

    performance tip 2:
    replace all instances of ‘filter:’ with ‘_filter:’

    performance tip 3: (better performance on non-IE browsers and in recent IE)
    in my testing, IE >= 8 doesn’t need this markup
    in modal-dialog.php replace lines 625 and 717 (which contain echo “n”; )
    with :
    echo “n”;
    echo “n”;

    in modal-dialog.php replace line 647 and 739 (which contain echo “”; )
    with:
    echo “”;
    echo “n”;

    cheers and keep up the good work;
    Sandro Bilbeisi

    Like

    1. Ouch !!! the source code was stripped from my previous post !! hope this fixes it
      find code (lines 625 and 717):
      echo “<STYLE>n”;
      replace with:
      echo “<!–[if lt IE 7]>n”;
      echo “<style type=’text/css’>n”;

      then find code (lines 647 and 739):
      echo “</STYLE>”;
      and replace with:
      echo “</style>”;
      echo “<![endif]–>n”;

      Like

    2. Hi Sandro, The IE CSS code could not be in the general stylesheet since it needed to have custom paths inside of it based on the plugin location. I tried using relative paths for the images but they would just not show up in IE.

      Like

  15. I have found an (XHTML 1.0 Strict) validation error

    line 829 of modal-dialog.php expresses:
    <a id=”inline” href=”#data”></a>

    error message: document type does not allow element “a” here; missing one of “p”, “h1”, “h2”, “h3”, “h4”, “h5”, “h6”, “div”, “pre”, “address”, “fieldset”, “ins”, “del” start-tag

    Like

  16. Hi Yannick,

    Thank you for making this plugin – it’s been a real help on our website.
    I wonder if you could take a look at our site, though — I recently updated to WP 3.1.2, having been on 3.0.2 for a while and using your 1.1.6 plugin version. After I updated your plugin to 2.0.6, the formatting has gone crazy — the window no longer has scroll capability, and the dialog box stays centered in the screen and won’t move.

    Is it possibly a JQuery issue which needs to get updated as well?

    David

    Like

    1. Hi David. Are you still having issues with Modal Dialog? I took a look at your site and see that the scroll bar is present in the dialog. Let me know if you still need assistance.

      Like

  17. Hi Yannick,

    thanks for this plugin. The configurable options are great. I’ve been through 3 other plugins before arriving at yours (simply because I was searching using different keywords).

    The only issue I’ve had so far is in Chrome for PC. I’m setting cookies manually with the code:

    ENTER

    and the modal pop up displays again when you go to every page. Possibly something with Chromes cookie handling or JS or jQuery loading?

    Do let me know if you have any suggestions and I appreciate your time. Thanks again!
    Brittney

    Like

    1. Hi Brittney, The code that you are using to set the cookies got stripped from your comment. Could you send it to me again using my contact form on the site?

      Like

  18. Yannick,

    Sweet plugin – can’t seem to get the dialog box to show up though 😦
    I’ll be using it for the Volunteer page, showing content from an external site.

    Thanks in advance for your help!

    Like

    1. I’m pretty sure my other plugins are causing conflicts with which jQuery version is loading. Is there a way to work around this? I’ve put the wp_enqueue_script in the header.php file but I don’t know where to go from there.

      Like

      1. Hi Ryan, Debugging Javascript issues can take some time. Where is the page where you have tried using Modal Dialog? A typical reason is that there is more than one version loaded between the theme and other plugins that you are using.

        Like

    1. It should work with cache plugins but I can’t say that I have done exhaustive testing for this. I do have some users that use Modal Dialog with caching systems.

      Like

  19. Hello Yannick,

    Thank you for this great plugin.
    I would like to install this plugin on my website, but it is not showing up on my website. I checked the source code of my website, and found some jquery scripts – which are used by wp-includes/…

    Would you please check out how to enable this plugin? 🙂

    Thank you very much

    Martijn

    Like

    1. Hi Martijn, Sorry for the late response. I see that you went with another popup plugin. I hope that it works as you wanted.

      Like

    1. Hi Rich, Sorry for the late reply. I do not see Modal Dialog enabled on your site. I guess you turned it off since it took such a long time replying to you. If you would like me to see why it was nor showing up, please reactivate and let me know.

      Like

    1. Hi Ian, I am not sure that I understand your question. You should normally just put the shortcode in the body of your post or page. Alternatively, if you want to programatically trigger the execution of a shortcode from a template, you would need to call the function:

      Like

  20. Hey Paul. Great work with the plugin. I just wanted to tell you that I’m trying to set it up for my website and I can’t make it work no matter how much I try. I don’t know whether I have to install another plugin in order to make yours work… so I would really appreciate it if you could tell me what to do. I want to start a campaign for June and I want the dialogue to pop up on all pages. So far, I didn’t manage to even make it appear on one page. I’ve played with all the option, but still to no result.

    The website is http://www.sunmodels.ro

    Kind regards,
    Michael

    Like

    1. Hi Michael. Hmm… my name is Yannick, not Paul. there is probably a jQuery conflict on your site preventing Modal Dialog from showing up. If you reactivate the plugin, then I can try to see why it was not working.

      Like

  21. Hi, Thanks for this plugin but I have a problem since it changed to have more than one configuration.

    No when I try and make a change and save settings, nothing happens. So if the state was set as activated it cant be turned off and vice versa.

    I tried using chrome and firefox to both edit and view pop up, cleared cookies and increased number of times to appear to 1000 while I’m testing it.

    The older version of modal didn’t have this issue. I saw that there was a jquery issue with someone else but couldnt se the code you posted to see if it is the same issue with me.

    Also I have modal on more than one site using different themes and they all have this issue(the one running the new version).

    Thanks in advance.
    Richard

    Like

    1. Hi, Its OK Yannick I sorted it out.

      It was because I had cleared out the dialouge size parameter boxes and clicked auto size. For some reason the pop up is not displayed when I do this.

      Its working fine again now.

      Rich

      Like

  22. If you have posted a question or comment over the past two months, I am very sorry for the delay. I should be able to get back to you in the next 2-3 weeks.

    Like

  23. Hey Yannick,

    I love your modal dialog plugin, it really is the best one out there. I use it on a few sites and never looked back.

    I do have a problem with the plugin on another site of mine though, it runs the Flexibility 3 theme. The modal dialog won’t show up no matter what I do. Is there anyway you could help me out?

    The site is: http://networkfaxmachine.net/

    Thanks!
    Thor

    Like

    1. Hi Thor.V1,

      I took at look at your site and I am not seeing the Modal Dialog output in the footer. You should check inside of the footer.php file in your theme to see if there is a call to wp_footer(); in the code. If not, add it, and Modal Dialog should then work correctly.

      Let me know if this works.

      Like

  24. I put the tag right before the tag in the footer and now it works! Thanks a lot for your help man, you rock!

    Like

  25. Hi ,

    There is a way to move the box upper o lower …. i don’t want the box in the middle 🙂

    Thx alot
    Maurizio

    Like

  26. I had used your plug in for a few days and then I started getting a warning about the domain that houses the html files your plug in was playing. The message said “visiting this site may harm your computer” it appears to contain malware…

    Is it caused by this plug in?

    – Ken

    Like

    1. Hi Ken, Was this a browser error, or perhaps a pop-up error. Modal Dialog would not display this type of error.

      Like

    1. Hi Stéphane, I do not see Modal Dialog output on your site anymore. Did you deactivate it? I would need it to be activated to troubleshoot the issue.

      Like

  27. Hi Yannick!
    I love your modal dialog plugin too. Thank you for your help.
    I’m new to wordpress … I think much more … rssssss
    I’m trying to set the Modal Dialog to open only in the home page for, but the home page has no ID (htt ://…/ wordpress /)
    How can I do to open the Modal Dialog only on the home page (static and without post)?
    Thank you very much!!!!!

    Marco Juric

    Like

    1. Hi Marco, to get Modal Dialog only to show on the front page, you would need to check the ‘Only show on specific pages and single posts’ as well as the ‘Display on front page’ option, and leave the ‘Pages and posts to display Modal Dialog (empty for all, comma-separated IDs)’ field empty.

      Like

  28. Hi,

    I’ve upgraded to the latest version of Modal and it’s conflicting with a Twitter feed and I’ve lost my Cufon fonts.

    Do you either have a fix of can I get an older download?

    Thanks,

    P

    Like

  29. I have tried to use your plugin but it seems that it conflicts with the standalone fancybox plugin. Is there anything I can do to make them work together?

    Thank you,
    Anton

    Like

    1. Not easily. If two plugins are loading each their own version of fancybox, especially different versions of fancybox, then fixing the problem would require modifying one plugin’s code.

      Like

    1. Hi Nadirk, You can put anything you want by writing standard HTML code to load external elements.

      Like

  30. Hi Yannick,

    Your plugin is very cool ! Thanks !
    But I have a problem… I’d like to use a shortcode wich could run php script but your plugin isn’t read php..
    For the shortcode, I found this :
    replace this (l. 835) :
    $output .= stripslashes($options[‘dialogtext’]);
    with :
    $output .= do_shortcode(stripslashes($options[‘dialogtext’]));

    But how to enable php ? :/

    Sorry for my poor english (I’m French..)

    Thanks in advance !
    Bouddhalight

    Like

    1. Bonjour Yann, Je ne suis pas certain de comprendre ce que tu essaie de faire ici en changeant cette ligne de code en inscrivant do_shortcode. Peut-tu essayer de mieux expliquer en francais? Je suis Québécois Francophone.

      Like

  31. Hello! I’m wondering if there is a way to have the modal window pop up when clicking a link, rather than loading automatically on a page load? Thanks!

    Like

    1. Hi David. Yes, this is possible. Just set Modal Dialog for manual trigger in the options, then use the following code to open it, or something along these lines.

      [a href="#" onClick="openDialog()" rel="nofollow"]Click here to open dialog[/a]
      
      [script type="text/javascript"]
      function openDialog() {
      jQuery("a#inline").trigger('click')
      }
      [/script] 

      Just replace the square brackets with HTML brackets.

      Like

  32. I am trying to use a modal window to “encourage” users to register. I would love for the plugin to determine if the user is logged in and only display the pop-up if they are not logged in. I would like the window to pop-up every X many clicks if they do not register. Any thoughts?

    Like

    1. Hi Kevin, Both of these functionality would require a little work on Modal Dialog but are quite feasible. I will try to incorporate these new features in the next update to the plugin.

      Like

      1. Hi Kevin, Please check out Modal Dialog 2.2 for two new options. One lets you specify the number of page loads between showing the dialog and the other does not display the dialog for users that are logged in. Let me know if these work as you expected.

        Like

    1. Hi Dave, If you choose inline content, then that content is output inside of the page code and might get picked up by Google, although I am not an expect on SEO optimization. If you choose to show a web page in the dialog, then only the address to that page will be part of your site.

      Like

  33. That’s fantastic!!! I really appreciate the update. I tested it briefly and it appeared to do exactly what I was looking for. I will test it some more tomorrow and let you know how it goes.

    Like

  34. Hi Yannick, since a while now I’m looking for a good plugin to show clean popups and it appears that the dialog box plugin is just perfect. Only thing is that I don’t get it to work.
    It is set to active. After deleting my cookies, I’m still not able to see the plugin do its thing. Does this plugin easily works together with caching plugins?
    Also, I would like to suggest a nice feature: maybe it is possible to let the admins preview the popup?

    Like

    1. Hi Yannick, maybe a little update… I got it to work, but can’t seem to get anything in it. In FF I see a white background (although I changed it) and in chrome I see a iframe of my own homepage in the modal box.

      Like

      1. Hi Paul, Is Modal Dialog installed on your primary site? I am not seeing it be activated. Or perhaps you only activated it to show on a particular page? If you give me a link, I can go and see why it’s not coming up.

        Like

    1. Hi Unbergail, Please try upgrading to version 2.2.1, which will soon be up on the site. If that does not work correctly, then try going to the Configuration page for the dialog and saving the settings. Please let me know which of these two paths gets the dialog back up and running.

      Like

    1. Hi Paul, Instead of deactivating the plugin, can you configure it so that it only shows up on a page that normal visitors don’t see. This way I could take a look at the problem in action and see why it’s not working as expected.

      Like

Comments are closed.

Create your website at WordPress.com
Get started
%d bloggers like this: