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

XF 1.4 Is there a way to open a template in an overlay

Discussion in 'XenForo Questions and Support' started by Crazy-Achmet, Nov 12, 2014.

  1. Crazy-Achmet

    Crazy-Achmet Active Member

    Hi everybody,

    in my opinion it must be a very simple thing i would like to do.

    I've created a new template called "question_single". Now i would like to have a link somewhere, that opens an overlay with exact that template.

    Is there a way to do it without an addon? I don't care about the route / url structure, i just want to display that template in an overlay. ;)

    Would be great if someone could help me. :)

    Thanks a lot so far.

    All the best

  2. Brogan

    Brogan XenForo Moderator Staff Member

    Use the OverlayTrigger class.
  3. Crazy-Achmet

    Crazy-Achmet Active Member

    Thanks, but i know that! :) I have the problem with the other part. I don't know how to get my custom template into the overlay / href part. ;)
  4. Brogan

    Brogan XenForo Moderator Staff Member

    An overlay is just a route/template displayed as an, well, overlay.

    It requires the supporting code in the first place.

    Click on the Preferences link in your account dropdown in the nav bar for example.
    It is actually this page: https://xenforo.com/community/account/preferences
    Crazy-Achmet likes this.
  5. Russ

    Russ Well-Known Member

    Have you tried creating a page with your html from the template on it, then link to the page using the OverlayTrigger class?
    Crazy-Achmet likes this.
  6. Crazy-Achmet

    Crazy-Achmet Active Member

    Ok, i could do that, thanks! I've thought there would be a better way to display my template.
  7. Russ

    Russ Well-Known Member

    Once you create your page node, you can still edit it via templates - Appearance -> Templates -> _page.node.#

    It's how I usually edit my pages.
    Crazy-Achmet likes this.
  8. Crazy-Achmet

    Crazy-Achmet Active Member

    And that's the trick i didn't knew! Perfect! Thank's a lot

Share This Page