Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
Manual Add Navbar Links [Plus Image Menu] Details »»
Manual Add Navbar Links [Plus Image Menu]
Version: 1.00, by SoltanWorld SoltanWorld is offline
Developer Last Online: Oct 2013 Show Printable Version Email this Page

Category: Add-On Releases - Version: 4.x.x Rating:
Released: 07-15-2010 Last Update: Never Installs: 23
Template Edits
Code Changes  
No support by the author.

This solution allow you to add links in navbar by editing navbar template yourself :

Some Hacks and Modification that you have installed on your forum, adds a link in the middle of navbar, so you can easily have one :

This is suitable for forumes with image navbar like mine : http://soltanworld.com


If you have use this Solution do not forget to mark az installed
----------------------------------------------------------------



- How to add links

To add Links in navbar you should first know some information about navbar and navtabs

some phrase like :

{vb:raw template_hook.navtab_start}
{vb:raw template_hook.navtab_middle}{vb:raw template_hook.navtab_end}

Q:What does this phrases mean?

A: First Phrase
{vb:raw template_hook.navtab_start}, is the start of navtabs. Befor This Phrase means that you link would appear always the first one and the ones you put after this phrase due to how you put the links in order would be sortet in navtabs .
Any Links you put in order after
{vb:raw template_hook.navtab_start} untill this phrase would be shown as you did : {vb:raw template_hook.navtab_middle} , And after this phrase like the start any links after this would be sorted as middle of navtabs, so you can have separator between items you want to add betweens.
And if you want to add a link at the end of navtabs you should find this phrase
{vb:raw template_hook.navtab_end} and add you link before this phrase.

e.g :
Code:
 {vb:raw template_hook.navtab_start}
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT !=  'search'">
             <li class="selected"><a class="navtab" href="link">title</a>
         <vb:else />
             <li><a class="navtab" href="link">title</a></li>
         </vb:if>
{vb:raw template_hook.navtab_middle}<vb:if condition="!$vboptions['selectednavtab'] AND  THIS_SCRIPT !=  'search'">
             <li class="selected"><a class="navtab" href="link">title</a>
         <vb:else />
             <li><a class="navtab" href="link">title</a></li>
         </vb:if>
{vb:raw template_hook.navtab_end}
-For Navbar menu - Sub Menu

Each Navtab link can contains submenu which calles navbar and popup menu

for navbar (under navtabs) items you should use this :


Notice : to add this in navtabs sub menu, you should add this before <vb:else> Please follow the example

Code:
<li><a class="navtab" href="YourLink">Link Title</a>
<ul class="floatcontainer">
                    {vb:raw template_hook.navbar_start}
                    
                        <li><a href="link">title</a></li>
                
                    {vb:raw template_hook.navbar_end}
                </ul>
</li>

and for navbar child menu you can use this as popup menu :

Code:
<li><a class="navtab" href="YourLink">Link Title</a>
<li class="popupmenu">
                        <a href="javascript://" class="popupctrl">navbar link title</a>
                        <ul class="popupbody popuphover">
                            <li><a href="link">sub menu title 1</a></li>
                            <li><a href="link">sub menu title 2</a></li>
                            <li><a href="link">sub menu title 3</a></li>
                        </ul>
                    </li>
</li>

e.g :

Navtab + Navbar + Popup menu

Code:
{vb:raw template_hook.navtab_start}
 <vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT !=  'search'">
              <li class="selected"><a class="navtab" href="link">title</a></li>
          <vb:else />
<li><a class="navtab" href="link">title</a></li>
          </vb:if>

{vb:raw template_hook.navtab_middle}

 <vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT !=  'search'">     
    <li><a class="navtab" href="link">title</a>          
        <ul class="floatcontainer">

            {vb:raw template_hook.navbar_start}
                <li><a href="link">sample navbar item</a></li>
                    <li class="popupmenu">
                        <a href="javascript://" class="popupctrl">contain popup menu item</a>
                        <ul class="popupbody popuphover">
                            <li><a href="link">title</a></li>
                            <li><a href="link">title</a></li>
                            <li><a href="link">title</a></li>
                            <li><a href="link">title</a></li>
                        </ul>
                    </li>
            {vb:raw template_hook.navbar_end} 

        </ul>
            </li>
<vb:else />
              </li>
    <li><a class="navtab" href="link">title</a></li>
          </vb:if>
{vb:raw template_hook.navtab_end}
-For Image Navtabs :

First of all you need to edit your css file and Stylevar (navbar) to set your desired setting and then You should replace text with this tag in navbar template:
<img src="link">


like :

Code:
  
  <vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT !=  'search'">
               <li class="selected"><a class="navtab" href=" Link 
Code:
"><img src="link"></a>
           <vb:else />
               <li><a class="navtab" href="link">title</a></li>
           </vb:if>
If you have use this Solution do not forget to mark az installed

Screenshots

File Type: jpg navbar-soltanworld.jpg (29.2 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
barakuda

Comments
  #2  
Old 07-16-2010, 11:54 AM
SoltanWorld's Avatar
SoltanWorld SoltanWorld is offline
 
Join Date: Feb 2010
Location: Loas Angeles
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First Post is Reserved
Reply With Quote
  #3  
Old 07-16-2010, 12:04 PM
ellinofatsa ellinofatsa is offline
 
Join Date: Mar 2010
Posts: 348
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanksssssssssss
Reply With Quote
  #4  
Old 07-16-2010, 01:25 PM
BlackJacket's Avatar
BlackJacket BlackJacket is offline
 
Join Date: Nov 2008
Location: 070108111114105100100
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This should be in Template Modifications...
Reply With Quote
  #5  
Old 07-16-2010, 04:15 PM
Greight's Avatar
Greight Greight is offline
 
Join Date: Oct 2009
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the nice mod. I wish there was a way all the edits could run automatically.

Quote:
Originally Posted by BlackJacket View Post
This should be in Template Modifications...
I think we have moderators who meant to tell us that ...
Reply With Quote
  #6  
Old 07-16-2010, 05:02 PM
SoltanWorld's Avatar
SoltanWorld SoltanWorld is offline
 
Join Date: Feb 2010
Location: Loas Angeles
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Greight View Post
Thanks for the nice mod. I wish there was a way all the edits could run automatically.

Sry i've not got mastered enough to make it as a Hack. But i will try my best.
Reply With Quote
  #7  
Old 07-18-2010, 03:47 AM
Jay Lee Jay Lee is offline
 
Join Date: Jun 2010
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi SoltanWorld, thanks for this great mod. I'm trying to do almost exactly what you're doing, so this is a great start. A question I have for you is, how do you customize the navbar below the navtab? For example, in your website:

http://www.soltanworld.com/forum/forum.php has "Today's Posts", "FAQ", "Calendar", etc. under the navtab images.
http://www.soltanworld.com/forum/xperience.php has nothing under the navtab images.
http://www.soltanworld.com/forum/local_links.php has "Categories", "Show" & "Search" under the navtab images.

How do I do this? I was looking at another similar thread but so far haven't been able to figure out a solution. Any help would be greatly appreciated. Thanks!
Reply With Quote
  #8  
Old 07-19-2010, 06:40 AM
SoltanWorld's Avatar
SoltanWorld SoltanWorld is offline
 
Join Date: Feb 2010
Location: Loas Angeles
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks dear,I think this would works :

Code:
<li><a class="navtab" href="YourLink">Link Title</a>
<ul class="floatcontainer">
					{vb:raw template_hook.navbar_start}
					
						<li><a href="link">title</a></li>
				
					{vb:raw template_hook.navbar_end}
				</ul>
</li>
but when i check the original code of navbar template, it contains some raw like

{vb:raw template_hook.navbar_after_faq}
{vb:raw template_hook.navbar_after_pm}

and i think for popup menu it would work too

Code:
<li><a class="navtab" href="YourLink">Link Title</a>
<li class="popupmenu">
						<a href="javascript://" class="popupctrl">navbar link title</a>
						<ul class="popupbody popuphover">
							<li><a href="link">sub menu title 1</a></li>
							<li><a href="link">sub menu title 2</a></li>
							<li><a href="link">sub menu title 3</a></li>
						</ul>
					</li>
</li>
Reply With Quote
  #9  
Old 07-20-2010, 12:22 AM
gopherhockey's Avatar
gopherhockey gopherhockey is offline
 
Join Date: Jul 2002
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is nice, but how do I get the navbar to display "selected" when I'm actually on that page.

For example, I added a navbar link "Gallery" that links to my photopost. When I click on the link it takes me to /photopost but the Forum link in the navbar is the one still selected.
Reply With Quote
  #10  
Old 07-20-2010, 09:05 AM
SoltanWorld's Avatar
SoltanWorld SoltanWorld is offline
 
Join Date: Feb 2010
Location: Loas Angeles
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can use this code

Code:
		<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'">
			<li class="selected"><a class="navtab" href="link">title</a>
		<vb:else />
			<li><a class="navtab" href="link">title</a></li>
		</vb:if>
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:47 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07673 seconds
  • Memory Usage 2,338KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete