Announcement

Collapse
No announcement yet.

How To Add A Link To The Navbar

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Any Version] How To Add A Link To The Navbar

    Taken from Jake's Post. I just adjusted the code to reflect vb 3.6

    Admin CP -> Styles & Templates -> Style Manager -> Edit Templates -> Navigation/Breadcrumb Templates -> navbar

    Find this code. Add the code in red:
    Code:
    <!-- nav buttons bar -->
    <div align="center">
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px">
        <tr align="center">
        
        <td class="vbmenu_control"><a href="URL">TEXT</a></td>
            <if condition="$show['member']">
                <td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
            </if>
            <if condition="$show['registerbutton']">
                <td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
            </if>
            <td class="vbmenu_control"><a href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
            <td class="vbmenu_control"><a href="memberlist.php$session[sessionurl_q]">$vbphrase[members_list]</a></td>
            <td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td>
            <if condition="$show['popups']">        
                <if condition="$show['searchbuttons']">
                    <if condition="$show['member']">
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                    <else />
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                    </if>
                    <td id="navbar_search" class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[search]</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
                </if>
                <if condition="$show['member']">
                    <td id="usercptools" class="vbmenu_control"><a href="$show[nojs_link]#usercptools">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></td>        
                </if>
            <else />        
                <if condition="$show['searchbuttons']">
                    <td class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4">$vbphrase[search]</a></td>
                    <if condition="$show['member']">
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                    <else />
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                    </if>
                </if>
                <td class="vbmenu_control"><a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a></td>
                <if condition="$show['member']">            
                    <td class="vbmenu_control"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td>
                </if>            
            </if>
            <if condition="$show['member']">
                <td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out()">$vbphrase[log_out]</a></td>
            </if>
        </tr>
        </table>
    </div>
    <!-- / nav buttons bar -->
    Change URL and TEXT appropriately.

    Or to add a link to the Quick Links menu:
    Code:
        <!-- user cp tools menu -->
        <div class="vbmenu_popup" id="usercptools_menu" style="display:none">
            <table cellpadding="4" cellspacing="1" border="0">
            
            <tr><td class="thead">$vbphrase[quick_links]</td></tr>
                    <tr><td class="vbmenu_option"><a href="URL">TEXT</a></td></tr>
            <if condition="$vboptions['enablesearches']"><tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily">$vbphrase[todays_posts]</a></td></tr></if>
            <tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td></tr>
            <tr><td class="vbmenu_option"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td></tr>
                    
            <tr><td class="thead"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_control_panel]</a></td></tr>
            <if condition="$show['siglink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editsignature">$vbphrase[edit_signature]</a></td></tr></if>
            <!--<if condition="$show['avatarlink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editavatar">$vbphrase[edit_avatar]</a></td></tr></if>-->
            <tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editprofile">$vbphrase[edit_profile]</a></td></tr>
            <tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editoptions">$vbphrase[edit_options]</a></td></tr>
            
            <tr><td class="thead">$vbphrase[miscellaneous]</td></tr>
            <if condition="$show['pmstats']"><tr><td class="vbmenu_option"><a href="private.php$session[sessionurl_q]" rel="nofollow">$vbphrase[private_messages]</a></td></tr></if>
            <tr><td class="vbmenu_option"><a href="subscription.php$session[sessionurl_q]" rel="nofollow">$vbphrase[subscribed_threads]</a></td></tr>
            <tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[my_profile]</a></td></tr>
            <if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="online.php$session[sessionurl_q]">$vbphrase[whos_online]</a></td></tr></if>
            
            </table>
        </div>
        <!-- / user cp tools menu -->
    Or to add another row of navbar links for when the first row gets too full...

    This will add a second row of navbar links underneath the existing row. Edit this template:

    Admin CP -> Styles & Templates -> Style Manager -> -> Navigation / Breadcrumb Templates -> navbar

    Add the red code:

    Code:
    <if condition="$show['member']">
                <td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out()">$vbphrase[log_out]</a></td>
            </if>
        </tr>
        </table>
    </div>
    <!-- / nav buttons bar -->
    
    <!-- second nav button row -->
    <div align="center">
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px">
        <tr align="center">
            <td class="vbmenu_control"><a href="URL">LINKED TEXT</a></td>
        </tr>
        </table>
    </div>
    <!-- / second nav button row -->
    
    <br />
    <if condition="$show['forumdesc']">
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
        <tr>
            <td class="alt1" width="100%"><strong>$foruminfo[title]</strong> <span class="smallfont">$foruminfo[description]</span></td>
        </tr>
        </table>
        <br />
    </if>
    Add more instances of the blue code within the red code to add more links to that second row.

    If you would like to have the additional navbar above the PM and login box, you need to add the code here instead:

    Code:
    </script>
    
    <br />
    
    <!-- second nav button row -->
    <div align="center">
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px">
        <tr align="center">
            <td class="vbmenu_control"><a href="URL">LINKED TEXT</a></td>
        </tr>
        </table>
    </div>
    <!-- / second nav button row -->
    
    <!-- breadcrumb, login, pm info -->
    Or to add an additional popup menu to the navbar...

    Admin CP -> Styles & Templates -> Style Manager -> -> Navigation / Breadcrumb Templates -> navbar

    Find this code and add the red code:

    Code:
    <!-- nav buttons bar -->
    <div align="center">
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px">
        <tr align="center">
        
        <td class="vbmenu_control"><a href="URL">TEXT</a></td>
            <if condition="$show['member']">
                <td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
            </if>
            <if condition="$show['registerbutton']">
                <td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
            </if>
            <td class="vbmenu_control"><a href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
            <td class="vbmenu_control"><a href="memberlist.php$session[sessionurl_q]">$vbphrase[members_list]</a></td>
            <td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td>
            <if condition="$show['popups']">        
                <if condition="$show['searchbuttons']">
                    <if condition="$show['member']">
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                    <else />
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                    </if>
                    <td id="navbar_search" class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[search]</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
                </if>
                <if condition="$show['member']">
                    <td id="usercptools" class="vbmenu_control"><a href="$show[nojs_link]#usercptools">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></td>        
                </if>
                <td id="mypopupmenu" class="vbmenu_control"><a href="#mypopupmenu">MENU TITLE</a> <script type="text/javascript"> vbmenu_register("mypopupmenu"); </script></td>
            <else />        
                <if condition="$show['searchbuttons']">
                    <td class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4">$vbphrase[search]</a></td>
                    <if condition="$show['member']">
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                    <else />
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                    </if>
                </if>
                <td class="vbmenu_control"><a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a></td>
                <if condition="$show['member']">            
                    <td class="vbmenu_control"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td>
                </if>            
            </if>
            <if condition="$show['member']">
                <td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out()">$vbphrase[log_out]</a></td>
            </if>
        </tr>
        </table>
    </div>
    <!-- / nav buttons bar -->
    Change the MENU TITLE appropriately.

    Then in that same template, scroll to the very bottom. Add the the red code:

    Code:
    <!-- PAGENAV POPUP -->
    
        <div class="vbmenu_popup" id="pagenav_menu" style="display:none">
            <table cellpadding="4" cellspacing="1" border="0">
            <tr>
                <td class="thead" nowrap="nowrap">$vbphrase[go_to_page]</td>
            </tr>
            <tr>
                <td class="vbmenu_option" title="nohilite">
                <form action="$vboptions[forumhome].php" method="get" onsubmit="return this.gotopage()" id="pagenav_form">
                    <input type="text" class="bginput" id="pagenav_itxt" style="font-size:11px" size="4" />
                    <input type="button" class="button" id="pagenav_ibtn" value="$vbphrase[go]" />
                </form>
                </td>
            </tr>
            </table>
        </div>
    
        <!-- mypopupmenu -->
        <div class="vbmenu_popup" id="mypopupmenu_menu" style="display:none">
            <table cellpadding="4" cellspacing="1" border="0">
            
            <tr><td class="thead">MENU TITLE</td></tr>        
            <tr><td class="vbmenu_option"><a href="URL">LINKED TEXT</a></td></tr>
            </table>
        </div>
        <!-- / mypopupmenu -->
    
    <!-- / PAGENAV POPUP -->
    Change the MENU TITLE, URL, and LINKED TEXT appropriately. Add more instances of the blue code within the red code to add more links to the popup menu.
    Last edited by Gomjaba; Thu 17th Aug '06, 4:42pm.
    I'm not under the alkafluence of inkahol like some thinkle peep I am!

  • #2
    Note: For 3.8 the relevant 'nav button bar' section is:

    Code:
    <!-- nav buttons bar -->
    <div class="tborder" style="padding:$stylevar[cellspacing]px; border-top-width:0px">
        <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
        <tr align="center">
            <if condition="$show['member']">
                <td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
            </if>
            <if condition="$show['registerbutton']">
                <td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
            </if>
            $template_hook[navbar_buttons_left]
            <td class="vbmenu_control"><a rel="help" href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
            <if condition="$show['communitylink'] AND $show['popups']">
                <td class="vbmenu_control"><a id="community" href="$show[nojs_link]#community" rel="nofollow" accesskey="6">$vbphrase[community]</a> <script type="text/javascript"> vbmenu_register("community"); </script></td>
            <else />
                <if condition="$show['memberslist']">
                    <td class="vbmenu_control"><a href="memberlist.php$session[sessionurl_q]">$vbphrase[members_list]</a></td>
                </if>
                <if condition="$show['quick_links_groups']">
                    <td class="vbmenu_control"><a href="group.php?$session[sessionurl]">$vbphrase[social_groups]</a></td>
                </if>
            </if>
            <td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td>
            <if condition="$show['popups']">
                <if condition="$show['searchbuttons']">
                    <if condition="$show['member']">
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                    <else />
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                    </if>
                    <td class="vbmenu_control"><a id="navbar_search" href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[search]</a> <if condition="$show['quicksearch']"><script type="text/javascript"> vbmenu_register("navbar_search"); </script></if></td>
                </if>
                <if condition="$show['member']">
                    <td class="vbmenu_control"><a id="usercptools" href="$show[nojs_link]#usercptools" accesskey="3">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></td>
                </if>
            <else />
                <if condition="$show['searchbuttons']">
                    <td class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4">$vbphrase[search]</a></td>
                    <if condition="$show['member']">
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                    <else />
                    <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                    </if>
                </if>
                <td class="vbmenu_control"><a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a></td>
                <if condition="$show['member']">
                    <td class="vbmenu_control"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_contacts]</a></td>
                </if>
            </if>
            $template_hook[navbar_buttons_right]
            <if condition="$show['member']">
                <td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out('$vbphrase[sure_you_want_to_log_out]')">$vbphrase[log_out]</a></td>
            </if>
            </tr>
        </table>
    </div>
    <!-- / nav buttons bar -->
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment

    Related Topics

    Collapse

    Working...
    X