vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Miscellaneous Hacks - Multiple Navbars (https://vborg.vbsupport.ru/showthread.php?t=127525)

optrex 09-24-2006 09:00 PM

Multiple Navbars
 
There is always a demand for increased navigation from your vB Board. This modification has been tested on 3.6.x, 3.7.x and 3.8.x

Hardcoding a menu is the best way to add the increased functionaility, without adding server load and queries. This template modificiation explains how to add additional simple navbars to your website. By utilising exisitng vB code from within the Navbar template, the menu will appear on all pages, including in add-ons such as vBa and Photoplog and Photopost.


A working expample can be found at Midlands Weather Forum

The basis of the navigation bar (refered to as the 'Main Code') is as follows:

Code:

<!-- nav2 buttons bar by Optrex-->
 
<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">
 
 
<!--compile your links within this space, using the section types below -->
 
 
</tr>
</table>
</div>
 
<!-- / nav2 buttons bar by Optrex-->

To create a link visible to all usergroups add this code to replace the green section of the main code (above):
Code:

<td class="vbmenu_control"><a href="http://www.yoururlhere.com" >Title of your link</a></td>
To create a link visible only to members add this code to replace the green section of the main code (above):
Code:

<if condition="$show['member']">
<td class="vbmenu_control"><a href="http://www.yoururlhere.com" >Title of your link</a></td>
</if>

Placement is recommended above your existing navbar, due to the "drop down" lists.

Find the following line in your navbar template and place your compiled code above it.
Code:

<!-- nav buttons bar -->
<div align="center">


optrex 09-25-2006 11:39 AM

Links to useful hints and tips within this thread:

Adding an admin only link: https://vborg.vbsupport.ru/showpost....8&postcount=15
Border around navbar: https://vborg.vbsupport.ru/showpost....29&postcount=7
Make link open in new window: https://vborg.vbsupport.ru/showpost....9&postcount=22
Colour links: https://vborg.vbsupport.ru/showpost....7&postcount=23

Kaleem 09-25-2006 12:44 PM

Great come in handy :)

beduino 09-25-2006 01:46 PM

hi,
i will test and install - really useful!:D
tks
beduino

Reece^B 09-25-2006 02:17 PM

Great Hack Optrex.
Heres a screen shot to show my version. :)

bashy 09-25-2006 07:20 PM

Hi m8, i have put mine above the navbar and its missing the line above the top of the botton cell? www.bashys-place.com/forums top bar you'll see

Any ideas as to the code to add it please?

optrex 09-25-2006 07:27 PM

Hi Bashy, There are 2 ways round that the first is to remove the following coloured text

Code:

<!-- nav2 buttons bar by Optrex-->
<div align="center">
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px" >

or you can change the same coloured text to read 1px instead of 0px

bashy 09-25-2006 07:48 PM

Cheers m8, I added the 1 instead of removing it :)
All sorted now, thanks again!!

Hornstar 09-27-2006 07:36 AM

thanks for the tute. This is really helpful, I guess I could also add the navbar at the footer if I wanted right?

Could I also duplicate the current navbar so it shows in the footer? if so where should I add it?

Thanks

optrex 09-27-2006 11:27 AM

Yes the idea is you can create as many menu nars as you want. Because it's coded directly into the template there are no additional server loads or queries.

If you were putting it in the footer, I would choose to place it above
Code:

<!-- /content area table -->
Again be careful of the placement of drop downs if you are going to move/copy your original.

MJMoore 10-02-2006 08:35 AM

Just what I was looking for.. many thanks!

morrow 10-03-2006 01:17 AM

Thanks for the tip; it came in pretty handy!

smoknz28 10-03-2006 05:58 PM

Installed and definitely has saved me from my users getting frustrated of having to scroll to the right and back to the left. ;)

Thank you for sharing this with the rest of us. :D

dupont24 10-05-2006 09:38 PM

Thanks......:)

morrow 10-09-2006 05:15 AM

Something I'll add to this which I think is pretty useful... <at least it's been useful for me. :)>

The following will ad an 'ADMIN" link to your Navbar. Only admins will be able to see it.

under:
Code:

<!--compile your links within this space, using the section types below -->
add:
Code:

<if condition="$GLOBALS[show][admincplink]">
<td class="vbmenu_control"><a href="http://www.yoursite.com/forumdir/admincp/index.php?$session[sessionurl]">$vbphrase[admin]</a></td></if>

Hope you'll find it as useful as I do.

DPSR 10-09-2006 05:28 AM

Thanks Optrex, very usefull :)

optrex 10-09-2006 06:41 AM

Quote:

Originally Posted by morrow
Something I'll add to this which I think is pretty useful... <at least it's been useful for me. :)>

Thanks morrow, I'll add it to the hints and tips.

Of course its easy to see how this can be changed to "moderator" only too.

KevNJ 10-11-2006 11:54 PM

*uninstalls marky's multi menu due to not working with some mods/hacks*

*installs optrex mutple menu's*

works great thanks !

Reece^B 10-13-2006 10:24 AM

Quote:

Originally Posted by KevNJ
*uninstalls marky's multi menu due to not working with some mods/hacks*

*installs optrex mutple menu's*

works great thanks !

Same ;)

newbe_haselina 10-15-2006 04:37 AM

Quote:

Originally Posted by KevNJ
*uninstalls marky's multi menu due to not working with some mods/hacks*

*installs optrex mutple menu's*

works great thanks !

and "SAME" again :)

Just installed this hack on my test enviroment, because I'm perparing an upgrade to 3.6.2 and it works teriffic. thanks a lot for this hack.

because I'm no hero with this stuff, how can I change the color of the link? and is it possible to chose even the link opens in a new window or staying in the parent window? that's the point I would need some help :o

UncoderMom 10-15-2006 09:33 PM

*installed*

GREAT! Took only minutes!

Now what do I do to make some of these (but not all) open in a new window?

optrex 10-16-2006 06:21 AM

To open link in new window, add bold text:

Code:

<a href="http://www.yoururlhere.com" target="_blank" >Title of your link</a>

optrex 10-16-2006 06:58 AM

To make the link a different colour add the bold text, where cccccc is the html colour you want to use.

Code:

<a href="http://www.yoururlhere.com"> <font color="cccccc"> Title of your link</a> </font>

UncoderMom 10-16-2006 11:09 AM

Thank you very much!

Its looks nice and clean in my template too! I spot it right away! That will make for easy edit!

UncoderMom 10-16-2006 11:14 AM

Quote:

Originally Posted by optrex
To open link in new window, add bold text:

Code:

<a href="http://www.yoururlhere.com" target="_blank" >Title of your link</a>


Worked like a charm!

So much control this way! :)

newbe_haselina 10-17-2006 02:47 AM

Thanks optrex ... that's really awsome :P ... Thanks you very much for your help

Hull Driver 10-18-2006 05:09 AM

after spending many years with phpBB I am adjusting to this board that was a quick easy lesson on how things work on VB

excellent thank you:)

Al-Fateh 10-25-2006 04:53 PM

ok what template do all this coding go under?

optrex 10-25-2006 05:23 PM

Quote:

Originally Posted by Al-Fateh
ok what template do all this coding go under?

the answer to that question is in bold in the instructions

Al-Fateh 10-25-2006 05:48 PM

thanks working great

Al-Fateh 10-25-2006 06:37 PM

this is one of the best mods

midirtrider 10-27-2006 05:46 AM

Thanks for the info.. this is a great mod!

And something I deffiantly am glad I learned!

AllenMead 10-29-2006 03:22 PM

A silly question, but how do I get the new links I've added to the additional nav bar to line up to the left and not centred as I haven't got that many extra links can be seen here here

Excellent mod!

optrex 10-29-2006 07:09 PM

AllenMead, in the 4th line of code change <tr align="center"> to <tr align="left">

alawee.blawee 11-03-2006 04:43 PM

it doesn't work with the DJ Fluid style

hehe

https://vborg.vbsupport.ru/showthrea...=1#post1110105

optrex 11-03-2006 07:26 PM

It would be very easy for me to say its a bug in that hack, especially as its not been updated since RC, but as I don't have it installed, if you want to pm me some template information, I'll take a look.

I am assuming the skin uses the parent navbar, rather than relying on its own - ie when you look at the templates in style DJ, the navbar template is yellow not red?

optrex 11-03-2006 07:49 PM

Quote:

Originally Posted by alawee.blawee
it doesn't work with the DJ Fluid style
hehe
https://vborg.vbsupport.ru/showthrea...=1#post1110105

It does work, having just installed that skin in the fluid mode, it works fine. Like I say, you just need to modify the correct template for that style.

http://img299.imageshack.us/img299/7792/menuej7.th.jpg

alawee.blawee 11-04-2006 06:51 AM

Sir If you look at the pic you put you are gonna see that some options came twice
like by example User Cp

can we make anything different and pass this problem?

optrex 11-04-2006 07:16 AM

That is because the designer of the skin has placed his navigation in the header. Just remove that part of code from the header template, or refer back to the person who made the skin for more advice.

alawee.blawee 11-04-2006 07:40 AM

ok thanx

let's wait for the Designer he might help us i hope

regards


All times are GMT. The time now is 09:03 AM.

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.02100 seconds
  • Memory Usage 1,816KB
  • 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
  • (11)bbcode_code_printable
  • (6)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
  • (40)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