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

XF 1.3 Overlay Inline Content

Discussion in 'XenForo Questions and Support' started by ForoStyle, Jul 15, 2014.

  1. ForoStyle

    ForoStyle Active Member

    I have this code in a template:
    HTML:
    <a href="?????">Click To View Content</a>
    
    <div id="contentToOverlay">
    This is an overlay content!
    </div>
    Is it possible to open the inline content (#contentToOverlay) in an overlay?
     
  2. ForoStyle

    ForoStyle Active Member

    Anyone know how to do this?

    I tried:
    HTML:
    <a href="#contentToOverlay" class="OverlayTrigger">Click To View Content</a>
    
    <div id="contentToOverlay">
    This is an overlay content!
    </div>
    but it's opening the whole page where I put this code.
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    You can use the OverlayTrigger class.
     
  4. ForoStyle

    ForoStyle Active Member

    That's what I did, post #2, but my problem is what should be the value for href to point to the inline content?
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    You use it like this:
    HTML:
    <a href="{xen:link 'whatever'}" class="OverlayTrigger myClass">{xen:phrase thing}</a>
     
  6. ForoStyle

    ForoStyle Active Member

    I apologize for being a noob to XF templating but I can't really make this work.

    What I have tried to do was I added this code in PAGE_CONTAINER template:
    HTML:
    <a href="{xen:link 'contentToOverlay'}" class="OverlayTrigger myClass">Click To View</a>
    <div id="contentToOverlay">
        This inline content should open in an overlay.
    </div>
    The code above will not open the inline content (#contentToOverlay) and will result in error : Route contentToOverlay/ could not be found.

    Any more ideas how to make this work?
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    All the OverlayTrigger class does is open this page (for example), http://xenforo.com/community/account/preferences in an overlay, when you click on Preferences in the dropdown menu under your name.

    The content you are trying to display in the overlay must have a corresponding template and route.
     
  8. ForoStyle

    ForoStyle Active Member

    Does it mean only external URLs/content can be open by Overlay?
     

Share This Page