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

XF 1.4 Set own menu items

Deceptive

Active member
#6
If you for example wanted to add "Staff Members" into a existing tab, you would do this:
Code:
<!-- members -->
     <xen:if is="{$tabs.members}">
       <li class="navTab members {xen:if $tabs.members.selected, 'selected', 'Popup PopupControl PopupClosed'}">
  
         <a href="{$tabs.members.href}" class="navLink">{$tabs.members.title}</a>
         <a href="{$tabs.members.href}" class="SplitCtrl" rel="Menu"></a>
    
         <div class="{xen:if {$tabs.members.selected}, 'tabLinks', 'Menu JsOnly tabMenu'} membersTabLinks">
           <div class="primaryContent menuHeader">
             <h3>{$tabs.members.title}</h3>
             <div class="muted">{xen:phrase quick_links}</div>
           </div>
           <ul class="secondaryContent blockLinksList">
           <xen:hook name="navigation_tabs_members">
             <li><a href="{xen:link members}">{xen:phrase notable_members}</a></li>
             <xen:if is="{$xenOptions.enableMemberList}"><li><a href="{xen:link members/list}">{xen:phrase registered_members}</a></li></xen:if>
             <li><a href="{xen:link online}">{xen:phrase current_visitors}</a></li>
             <xen:if is="{$xenOptions.enableNewsFeed}"><li><a href="{xen:link recent-activity}">{xen:phrase recent_activity}</a></li></xen:if>
<li><a href="{xen:link members, '', 'type=staff'}">Staff Members</a>
             <xen:if is="{$canViewProfilePosts}"><li><a href="{xen:link find-new/profile-posts}">{xen:phrase new_profile_posts}</a></li></xen:if>
           </xen:hook>
           </ul>
         </div>
       </li>
     </xen:if>
If you wanted a external link, replace this:
Code:
<li><a href="{xen:link members, '', 'type=staff'}">Staff Members</a></li>
With:
Code:
<li><a href="LINK HERE">Staff Members</a></li>
If you want to add a brand new tab, then look in the navigation template here to get a idea:
Code:
<!-- extra tabs: end -->
     <xen:if is="{$extraTabs.end}">
     <xen:foreach loop="$extraTabs.end" key="$extraTabId" value="$extraTab">
       <xen:if is="{$extraTab.linksTemplate}">
         <li class="navTab {$extraTabId} {xen:if $extraTab.selected, 'selected', 'Popup PopupControl PopupClosed'}">
  
         <a href="{$extraTab.href}" class="navLink">{$extraTab.title}<xen:if is="{$extraTab.counter}"><strong class="itemCount"><span class="Total">{$extraTab.counter}</span><span class="arrow"></span></strong></xen:if></a>
         <a href="{$extraTab.href}" class="SplitCtrl" rel="Menu"></a>
    
         <div class="{xen:if {$extraTab.selected}, 'tabLinks', 'Menu JsOnly tabMenu'} {$extraTabId}TabLinks">
           <div class="primaryContent menuHeader">
             <h3>{$extraTab.title}</h3>
             <div class="muted">{xen:phrase quick_links}</div>
           </div>
           {xen:raw $extraTab.linksTemplate}
         </div>
       </li>
       <xen:else />
         <li class="navTab {$extraTabId} {xen:if $extraTab.selected, 'selected', 'PopupClosed'}">
           <a href="{$extraTab.href}" class="navLink">{$extraTab.title}<xen:if is="{$extraTab.counter}"><strong class="itemCount"><span class="Total">{$extraTab.counter}</span><span class="arrow"></span></strong></xen:if></a>
           <xen:if is="{$extraTab.selected}"><div class="tabLinks"></div></xen:if>
         </li>
       </xen:if>
     </xen:foreach>
     </xen:if>
I'm not 100% sure with this either.