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

XF 1.5 Tab to link

Discussion in 'XenForo Questions and Support' started by Betclever, Dec 18, 2015.

  1. Betclever

    Betclever Active Member

    Hello all!

    I would like to know if it is possible to move a tab to a link like on the attached file?
    If yes, how?

    Thanks.
     

    Attached Files:

  2. Betclever

    Betclever Active Member

    Apparently, I have to add this code to the template navigation but I don't know where because I want to move this tab (link) to the forums tab so as a sublink:

    <li class="navTab PopupClosed"><a href="YOUR_LINK" class="navLink">MENU_LINK_TEXT</a></li>

    Any return will be helpful. :)
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    If it's a sub nav link, just copy the code for the links under the Forums tab in the template.
     
  4. Betclever

    Betclever Active Member

    Where exactly cause I found the forum tab under the template "navigation" but when I paste the code which is above with my link, nothing happens? :/
     
  5. Betclever

    Betclever Active Member

    This is the content of the forum tab:

    Code:
    <!-- forums -->
            <xen:if is="{$tabs.forums}">
           
                <xen:if is="@xb_nav_disablesub">
                <li class="navTab forums {xen:if $tabs.forums.selected, 'selected'} Popup PopupControl PopupClosed">
                <xen:else />
                <li class="navTab forums {xen:if $tabs.forums.selected, 'selected', 'Popup PopupControl PopupClosed'}">
               
                </xen:if>
                   
                    <a href="{$tabs.forums.href}" class="navLink<xen:if is="@xb_nav_disablearrow"> NoPopupGadget" rel="Menu</xen:if>">{$tabs.forums.title}</a>
                    <xen:if is="!@xb_nav_disablearrow"><a href="{$tabs.forums.href}" class="SplitCtrl" rel="Menu"></a></xen:if>
                    <div class="xbTabPopupArrow">
                        <span class="arrow"><span></span></span>
                    </div>
                   
                    <xen:if is="@xb_nav_disablesub">
                    <div class="{xen:if {$tabs.forums.selected}, 'selectedMenu'} Menu JsOnly tabMenu forumsTabLinks">
                    <xen:else />
                    <div class="{xen:if {$tabs.forums.selected}, 'tabLinks', 'Menu JsOnly tabMenu'} forumsTabLinks">
                    </xen:if>
    
                    <xen:if is="@xb_nav_stretch OR @xb_widen"><div class="xbMaxwidth"></xen:if>
                        <div class="primaryContent menuHeader">
                            <h3>{$tabs.forums.title}</h3>
                            <div class="muted">{xen:phrase quick_links}</div>
                        </div>
                        <ul class="secondaryContent blockLinksList">
                        <xen:hook name="navigation_tabs_forums">
                            <xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'forums/-/mark-read', $forum, 'date={$serverTime}'}" class="OverlayTrigger">{xen:phrase mark_forums_read}</a></li></xen:if>
                            <xen:if is="{$canSearch}"><li><a href="{xen:link search, '', 'type=post'}">{xen:phrase search_forums}</a></li></xen:if>
                            <xen:if is="{$visitor.user_id}">
                                <li><a href="{xen:link 'watched/forums'}">{xen:phrase watched_forums}</a></li>
                                <li><a href="{xen:link 'watched/threads'}">{xen:phrase watched_threads}</a></li>
                            </xen:if>
                            <li><a href="{xen:link 'find-new/posts'}" rel="nofollow" class="xbNewPosts">{xen:if $visitor.user_id, {xen:phrase new_posts}, {xen:phrase recent_posts}}</a></li>
                        </xen:hook>
                        </ul>
                    <xen:if is="@xb_nav_stretch OR @xb_widen"></div></xen:if>
                    </div>
                   
                    <xen:if is="@xb_offcanvas_menu">
                    <!-- XenBase Off Canvas Menu -->
                        <div class="xbOffCanvasSubMenu">
                        <ul>
                        <xen:hook name="navigation_tabs_forums">
                            <xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'forums/-/mark-read', $forum, 'date={$serverTime}'}" class="OverlayTrigger">{xen:phrase mark_forums_read}</a></li></xen:if>
                            <xen:if is="{$canSearch}"><li><a href="{xen:link search, '', 'type=post'}">{xen:phrase search_forums}</a></li></xen:if>
                            <xen:if is="{$visitor.user_id}">
                                <li><a href="{xen:link 'watched/forums'}">{xen:phrase watched_forums}</a></li>
                                <li><a href="{xen:link 'watched/threads'}">{xen:phrase watched_threads}</a></li>
                               
                            </xen:if>
                            <li><a href="{xen:link 'find-new/posts'}" rel="nofollow">{xen:if $visitor.user_id, {xen:phrase new_posts}, {xen:phrase recent_posts}}</a></li>
                        </xen:hook>
                        </ul>
                        </div>
                    <!-- END XenBase Off Canvas Menu -->
                    </xen:if>
                   
                </li>
            </xen:if>
            
     
  6. Russ

    Russ Well-Known Member

    Look at the:

    Code:
    <li><a href="{xen:link 'find-new/posts'}" rel="nofollow" class="xbNewPosts">{xen:if $visitor.user_id, {xen:phrase new_posts}, {xen:phrase recent_posts}}</a></li>
                        </xen:hook>
    add it right after that </li>

    p.s. you're running an outdated version of the style
     
  7. Betclever

    Betclever Active Member

    Wow, great!

    It works perfectly... :)
    However, I have a rectangle with an arrow for this link so is this normal? See att.
     

    Attached Files:

  8. Russ

    Russ Well-Known Member

    Remove any classes from the <li> // <a>
     
  9. Betclever

    Betclever Active Member

    This => <li class="navTab PopupClosed"> & class="navLink" ?
     
  10. Russ

    Russ Well-Known Member

    yes, it's no longer a navTab nor is a popup menu, make it just <li>
     
  11. Betclever

    Betclever Active Member

    It works! :)
    Thanks Russ once again. ;)
     

Share This Page