1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[Tutorial] Admin navbar tab + dropdown Favorites

Discussion in 'Tips and Guides [Archive]' started by Morgain, Jan 10, 2012.

  1. Morgain

    Morgain Well-Known Member

    I have made myself a very useful tab with links to the admin areas I use most often.
    (Uses Jake Bunce's nodes-as-tabs addon - link below.)

    WHAT THIS TUTORIAL DOES
    Creates a navbar tab to the Admin area, with a dropdown listing your own choice of admin links.
    Some options.

    [​IMG]

    HOW TO DO IT
    Main Step 1. Install Jake Bunce's nodes-as-tabs addon
    http://xenforo.com/community/threads/nodes-as-tabs-with-tab-selection.23295/
    See my sig if you're not experienced with installing addons.

    Main Step 2. Create a Link Forum linking to the admincp.
    Main Step 3. Create a list of links in a template this addon provides. You don't need to understand code to do this!

    Detailed steps:
    2. CREATE A LINK FORUM.
    Admin/Applications/ Node Tree/ Create New Node - select Link Forum.
    Title: Admin
    Link URL: http://www.yoursite.com/forum/admin.php
    OR http://www.yoursite.com/admin.php
    Root node is OK.
    Display Order althoughnot appearing publicly on the node tree the order will affect your admin list. So I make my Link Forums order at 100 (on a small node list!) to wait quietly at bottom of my admin page.
    If you want you can make your main admin link appear just for admins on the forums list. In that case TICK "Display in the node list" next.

    TICK: Display As Tab and Check Node Permissions
    (You probably don't want others to see this tab or link)
    Display Order: 13 and End to place at end of the navbar row, before the centre space.
    You might prefer Display Order: 1 and Home to tuck it on the left.
    Skip to Links Template:
    For the links to go underneath. But you have to create your list.
    Otherwise XF will complain you don't have it yet and refuse to Save.
    Leave this page open.


    3. CREATE YOUR OWN SECONDARY LIST OF LINKS
    Open another admincp page in your browser.
    (You could rightclick on Appearances on the top bar, and open it in a new page.)
    On this page click Templates left menu or big icon centre.
    You want nat_linkstemplate It'll be enough to put just nat in the searchbox to get it on a short list.

    In nat_linkstemplate CLICK in its text box. CTRL+A and CTRL+C to Copy all of it.
    Use your Back button to return to the main Templates page OR click Templates left menu.
    CLICK Create Template button top right.
    CLICK in the empty box. CTRL+V to Paste the stuff you Copied.

    Name your admin links list template. I called mine admin_tablinks
    If I ever need to look it up I just need to remember to put admin in the search to find it.

    In the box below see the area where you add the links you want.
    You don't need to understand the code to do this! Just carefully Copy and Paste.
    Code:
    <ul class="secondaryContent blockLinksList">
    <xen:if is="{$nodeTab.nat_markread} AND {$visitor.user_id} AND {$selected}">
    <li><a href="{xen:link 'forums/-/mark-read', $forum, 'date={$serverTime}'}" class="OverlayTrigger">{xen:phrase mark_forums_read}</a></li>
    </xen:if>
     
     <xen:comment>THESE ARE NEW INACTIVE SECONDARY LINKS</xen:comment>
     <xen:comment>
     <li><a href="{xen:link 'url1'}">Text1</a></li>
     <li><a href="{xen:link 'url1'}">Text1</a></li>
     </xen:comment>
     
    {xen:raw $childLinks}
    </ul>
    Only first you need to free the new green secondary links and make them active.
    At the moment the xen comment parts before and after the list of links are stopping them being active and viewable.
    Remember you have a safe backup copy - the original nat_linkstemplate you copied this from. So if you mess up it doesn't matter.

    COPY THESE TWO LINES
    Code:
    <li><a href="{xen:link 'url1'}">Text1</a></li>
    <li><a href="{xen:link 'url1'}">Text1</a></li>
    
    then PASTE them ABOVE THE LINE IN CAPITALS so it looks like this:

    Code:
    <li><a href="{xen:link 'url1'}">Text1</a></li>
    <li><a href="{xen:link 'url1'}">Text1</a></li>
     
    <xen:comment>THESE ARE NEW INACTIVE SECONDARY LINKS</xen:comment>
    
    Now in the first item listed replace url1 in the first line with a link you want e.g. admincp/ options
    That would look like this:
    Code:
    <li><a href="{xen:link 'http://www.yoursite.com/forum/admin.php?options/'}">Text1</a></li>
    <li><a href="{xen:link 'url1'}">Text1</a></li>
    
    Be careful not to delete the single comma ' each side of the URL - shown in red.

    Here's some of my list which might help get you started.
    To create more links on the list Copy/ Paste one already there and replace 2 bits.
    Code:
    <!-- OPTIONS -->
    <li><a href="{xen:link 'http://www.site.com/forum/admin.php?options/'}" target="_blank">Options</a></li>
    <!-- NODE TREE -->
    <li><a href="{xen:link 'http://www.site.com/forum/admin.php?nodes/'}" target="_blank">Node tree</a></li>
    <!-- TEMPLATES -->
    <li><a href="{xen:link 'http://www.site.com/forum/admin.php?styles/default-style.1/templates'}" target="_blank">Templates</a></li>
    <!-- PHRASES -->
    <li><a href="{xen:link 'http://www.site.com/forum/admin.php?languages/english-us.1/phrases'}" target="_blank">Phrases</a></li>
    <!-- STYLE PROPS -->
    <li><a href="{xen:link 'http://www.site.com/forum/admin.php?styles/default-style.1/style-properties'}" target="_blank">Style Properties</a></li>
    <!-- USERGROUPS -->
    <li><a href="{xen:link 'http://www.site.com/forum/admin.php?user-groups/'}" target="_blank">Usergroups</a></li>
    <!-- USERS -->
    <li><a href="{xen:link 'http://www.site.com/forum/admin.php?users/search'}" target="_blank">Search Users</a></li>
    

    <!-- OPTIONS --> is a note only I can see, so I know which line is which when I return to edit in the future.
    http://www.site.com/forum/admin.php?user-groups/'}" target="_blank"
    The complete URL link to insert as the target destination of the link.
    target="_blank" on the end makes it open in a new browser tab (From front website usually you want to refer back to see how what you're doing works out).
    bold blue name which will appear in your dropdown.

    Before you Save
    go to the top of the page: Copy/ Paste the title you gave this template. It's in large lettering.
    This is so you get it exactly right to put in your Link Forum as your final step.

    Now click the Save All Changes button at the bottom.

    FINISH THE LINK FORUM
    Go back to the page where your new Link Forum is waiting to finish.
    At the bottom Paste in the name of your new Links Template
    TICK Enable Popup Menu
    Click the Save Link Forum button.

    PERMISSION THE LINK FORUM?

    To make the tab (and the link in the public node tree/ forum list) ONLY appear to admins.

    Admin/Applications/ Node Tree/ - "Admin"
    CLICK the link Permissions - along its row a bit.
    TICK Private Node top left. Click the Update button.

    On the list of usergroups, below that button, CLICK Admin (at the top).
    CLICK View node: on the green box under the Allow column.
    CLICK the button Update Permissions at the bottom.


    All done. You should now see your new tab + its links dropdown
    IF you're logged in as admin.
     
    Motobaka, JamesBrown, ARSamo and 3 others like this.

Share This Page