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

Remove empty pageNavLinkGroup div from html

Discussion in 'Styling and Customization Questions' started by Luxus, Nov 3, 2012.

  1. Luxus

    Luxus Well-Known Member

    The pageNavLinkGroup container in forum view contains the pagination (for guests and registered members) and the pagination plus the SelectionCountContainer (for mods and admins). An empty pageNavLinkGroup container takes up 20px of space because there is margin applied to it. In the forum_view template I tried to get rid of the empty pageNavLinkGroup container with this code:

    Code:
    <xen:if hascontent="true">
    <div class="pageNavLinkGroup">
    <xen:contentcheck>
        <div class="linkGroup SelectionCountContainer">
            <xen:comment><xen:include template="forum_view_legacy_controls" /></xen:comment>
        </div>
    
        <xen:pagenav link="forums" linkdata="{$forum}" linkparams="{$pageNavParams}" page="{$page}" perpage="{$threadsPerPage}" total="{$totalThreads}" />
    </xen:contentcheck>
    </div>
    </xen:if>
    The red code is the code I added. Unfortunately it doesn't work. Odd is that this exact code works on other pages with pageNavLinkGroup containers. I think it's caused by the linkGroup SelectionCountContainer div because if I delete it then the code works. Any ideas?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Your xen:contentcheck has static HTML in it, so it will always be true. This should work:

    Code:
    <xen:if hascontent="true">
    <div class="pageNavLinkGroup">
        <div class="linkGroup SelectionCountContainer">
            <xen:comment><xen:include template="forum_view_legacy_controls" /></xen:comment>
        </div>
    <xen:contentcheck>
        <xen:pagenav link="forums" linkdata="{$forum}" linkparams="{$pageNavParams}" page="{$page}" perpage="{$threadsPerPage}" total="{$totalThreads}" />
    </xen:contentcheck>
    </div>
    </xen:if>
     
  3. Luxus

    Luxus Well-Known Member

    Thanks, but there's one problem with this code. It also removes the pageNavLinkGroup container for mods and admins. For them it isn't empty. It contains this:

    pagenav.png

    I only want to remove empty containers from the html.
     

Share This Page