vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] How add sub-menu drop down to the navbar (tab Forum) (https://vborg.vbsupport.ru/showthread.php?t=232579)

06GTOAZ 02-15-2012 04:37 AM

Thanks for posting up how to do this.

MacroPhotoPro 04-03-2012 12:35 AM

Quote:

Originally Posted by Lynne (Post 2230533)
Same way. Only find the template_hook names in the vbcms_navbar_link template.


How about just adding a single Navbar link to my Home/Forum/Blog Navbar (no submenus)?

What would be the correct coding for that?

Thanks!

rodeojones 04-25-2012 07:29 PM

Quote:

Originally Posted by MacroPhotoPro (Post 2316204)
How about just adding a single Navbar link to my Home/Forum/Blog Navbar (no submenus)?

What would be the correct coding for that?

Thanks!

$template_hook['vbcms_navbar_end'] .= '<li><a href="Your Link">Link Title</a></li>';

That is what I used in order to get the link on my homepage.

I would also like to ask for insight as to how to set the link so that only users with permissions can see the link.

Lynne 04-25-2012 08:34 PM

Put a condition around it.

HTML Code:

if (is_member_of($vbulletin->userinfo, x, y, z) {
code
}


rodeojones 04-30-2012 08:02 PM

Quote:

Originally Posted by Lynne (Post 2323498)
Put a condition around it.

HTML Code:

if (is_member_of($vbulletin->userinfo, x, y, z) {
code
}


Lynne, Thanks for the response. I used the following code in total and I didn't get a parsing error.

Code:

if (is_member_of($vbulletin->userinfo, Administrators)) {
$template_hook['vbcms_navbar_end'] .= '<li><a href="mylink">My Link</a></li>';
}

However, as the Admin I cannot see the link. Also, how would I add in usergroup names for permissions if the usergroup names have spaces in them?

Thanks again for your help :)

Lynne 04-30-2012 09:33 PM

x,y, and z are the usergroupids, not usergroup names. Replace Administrator with the usergroupid of your Administrator usergroup.

rodeojones 05-01-2012 01:21 PM

Excellent! Thanks again Lynne, it worked perfectly.

xony 06-02-2012 04:48 PM

update 4.2.0 and not found please ...

tambo 10-31-2012 11:27 AM

I'm wondering if anyone can advise on this?

VBulletin has special PHP variables that you can use in notices, such as {userid} and {username}, which will generate an output specific to the user.

I would like to use these variables in a search string (I know this works in notices) but, obviously, it doesn't work in these dropdowns because the search string is in javascript and won't be parsed (see example code below).

Is it somehow possible to get the special variable parsed server-side, then handed over to the javascript?

I've seen people talk about it, but nobody's provided a solution.

Thanks,
tambo

PHP Code:

<li class="popupmenu">
<
a href="javascript://" class="popupctrl">Menu test</a>
<
ul class="popupbody popuphover">
<
li><a href="http://www.example.com/search.php?do=process&query={username}">Test Search</a></li
</
ul>
</
li


Lynne 10-31-2012 03:38 PM

The variable you would use would depend on the template you use it in. Most likely you would be wanting $bbuserinfo[username]

tambo 11-03-2012 11:07 AM

haha... I'm afraid you might need to guide me a little more than that.

Is it possible to modify the code above so that I can understand where that variable would go and how it would be passed over to the javascript / hyperlink?

Lynne 11-03-2012 04:41 PM

Try something more like:

http://www.example.com/search.php?do=process&query={vb:raw bbuserinfo.username}

tambo 11-05-2012 06:46 PM

Ah, Lynne.... you absolute star!

Thankyou.

<3

Blue-Inc 05-01-2013 06:35 PM

Where can I find the CSS for the drop down menu?

I'd like to customise the CSS to my own liking for my forum and add it to additional.css!

Thanks.

Jpolola 05-04-2013 05:22 AM

I can`f find second method (navbar template on VB 4.2.0 PL3
HTML Code:

<div id="navbar" class="navbar">
        <ul id="navtabs" class="navtabs floatcontainer<vb:if condition="$show['member'] AND $notifications_total"> notify</vb:if>">
                {vb:raw template_hook.navtab_start}
                {vb:raw navigation}
                {vb:raw template_hook.navtab_end}
        </ul>
        <vb:if condition="$vboptions['enablesearches']">
                <div id="globalsearch" class="globalsearch">
                        <form action="search.php?{vb:raw session.sessionurl}do=process" method="post" id="navbar_search" class="navbar_search">
                                <vb:comment><input type="hidden" name="s" value="{vb:raw session.sessionurl}" /></vb:comment>
                                <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
                                <input type="hidden" name="do" value="process" />
                                <span class="textboxcontainer"><span><input type="text" value="" name="query" class="textbox" tabindex="99"/></span></span>
                                <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search<vb:if condition="$stylevar['textdirection'] == 'rtl'">_rtl</vb:if>.<vb:if condition="is_browser('ie') AND !is_browser('ie', 7)">gif<vb:else />png</vb:if>" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span>
                        </form>
                        <ul class="navbar_advanced_search">
                                <li><a href="search.php{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li>
                                {vb:raw template_hook.navbar_advanced_search}
                        </ul>
                </div>
        </vb:if>
</div>
</div><!-- closing div for above_body -->

<div class="body_wrapper">
<div id="breadcrumb" class="breadcrumb">
        <ul class="floatcontainer">
                <li class="navbithome"><a href="index.php{vb:raw session.sessionurl_q}" accesskey="1"><img src="{vb:stylevar imgdir_misc}/navbit-home.png" alt="{vb:rawphrase home}" /></a></li>
                {vb:raw navbits.breadcrumb}
                {vb:raw navbits.lastelement}
        </ul>
        <hr />
</div>

{vb:raw ad_location.ad_navbar_below}
{vb:raw ad_location.global_below_navbar}

<vb:if condition="$show['notices'] AND THIS_SCRIPT != 'register'">
        <form action="profile.php?do=dismissnotice" method="post" id="notices" class="notices">
                <input type="hidden" name="do" value="dismissnotice" />
                <input type="hidden" name="s" value="{vb:raw session.sessionurl}" />
                <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
                <input type="hidden" id="dismiss_notice_hidden" name="dismiss_noticeid" value="" />
                <input type="hidden" name="url" value="{vb:raw return_link}" />
                <ol>
                        {vb:raw notices}
                </ol>
        </form>
</vb:if>

--------------- Added [DATE]1367648798[/DATE] at [TIME]1367648798[/TIME] ---------------

Any Idea how to add this code
PHP Code:

<li class="popupmenu">
<
a href="javascript://" class="popupctrl">Menu test</a>
<
ul class="popupbody popuphover">
<
li><a href="http://www.vbulletin-ressources.com/forum">test 1</a></li>
<
li><a href="http://www.vbulletin-ressources.com/forum">test 2</a></li
<
li><a href="http://www.vbulletin-ressources.com/forum">test 3</a></li>   
</
ul>
</
li


StonePilot 04-30-2014 07:43 PM

Seems people don't want to mess with updating this anymore.

Mega Menu? Nested dropdowns? Put a menu with links inside a menu?

Lynne 04-30-2014 08:08 PM

Quote:

Originally Posted by StonePilot (Post 2495552)
Seems people don't want to mess with updating this anymore.

Mega Menu? Nested dropdowns? Put a menu with links inside a menu?

This article covers one thing - adding a sub-menu downdown to the navbar. There is nothing in the description that says anything about covers those other items.


All times are GMT. The time now is 04:10 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03080 seconds
  • Memory Usage 1,790KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_html_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (17)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete