1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to create a pop-up modal in XenForo?

Discussion in 'XenForo Development Discussions' started by Terry Love, Jul 5, 2014.

  1. Terry Love

    Terry Love Member

    Hello,

    I'm in the process of creating a full page background ad for a forum system. I'd like to have it so that when a user clicks a button, the JavaScript method that is fired is able to open up a confirmation box asking them if they want to follow through with going to the site. I've been searching for a simple way to do this for about an hour now. Haven't had much luck, so I figure a new thread for this is in order.

    How do we create (with code) new pop-up modals similar to the pop-up modals that are shown when a user avatar is clicked, or when a profile is viewed from the thread view page.

    -Taylor
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Do you mean the overlay?
    If so, you can use the OverlayTrigger class.
     
  3. Terry Love

    Terry Love Member

    That's the one I'm trying to use, yes. Are there any examples or documentations you can point me to that I should be reading?

    Thanks
     
  4. Terry Love

    Terry Love Member

  5. Brogan

    Brogan XenForo Moderator Staff Member

    You just use it in your template, like so:

    Code:
    <a href="{xen:link 'route/link', $param}" class="OverlayTrigger">{xen:phrase thing}</a>
     
    Terry Love likes this.

Share This Page