vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Add-On Releases - Manual Add Navbar Links [Plus Image Menu] (https://vborg.vbsupport.ru/showthread.php?t=246687)

SoltanWorld 07-15-2010 10:00 PM

Manual Add Navbar Links [Plus Image Menu]
 
1 Attachment(s)
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

SoltanWorld 07-16-2010 11:54 AM

First Post is Reserved

ellinofatsa 07-16-2010 12:04 PM

thanksssssssssss

BlackJacket 07-16-2010 01:25 PM

This should be in Template Modifications...

Greight 07-16-2010 04:15 PM

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

Quote:

Originally Posted by BlackJacket (Post 2070082)
This should be in Template Modifications...

I think we have moderators who meant to tell us that ...

SoltanWorld 07-16-2010 05:02 PM

Quote:

Originally Posted by Greight (Post 2070181)
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.

Jay Lee 07-18-2010 03:47 AM

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!

SoltanWorld 07-19-2010 06:40 AM

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>


gopherhockey 07-20-2010 12:22 AM

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.

SoltanWorld 07-20-2010 09:05 AM

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>



All times are GMT. The time now is 06:41 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.01245 seconds
  • Memory Usage 1,786KB
  • 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
  • (9)bbcode_code_printable
  • (2)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
  • (10)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