The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vB4.2 Navigation Manager - how to discussion
I have vB 4.2.0 BETA 1 running in my test system. Products that use templates/hooks to integrate with the navbar will need the following changes to work with the Navigation Manager. Please post code snips and hints in this thread, we are all on a learning curve. 1. Remove old style navigation hooks/templates etc. 2. Create a new <navigation> section in the product XML file (You can create the navigation in the navigation manager, linked to a product then export the product file as a skeleton) 3. Set any conditionals in a hook or in your main code Eg. $show['apmgtug'] = true; is set for one of the menu items in my example My example relies on $show['member'] = true; as well. Leave the <show> tag empty for 'public' tabs/links 4. If you have multiple scripts, leave <scripts> blank and set $root at the new hooks set_navigation_tab_fallaback or set_navigation_tab_vbview Code:
if (<some condition>) $root= '<name of tab>'; I would probably have a new vB4.2 code base because of the differences, you could have the same code base with some sort of version check. In the end the new navigation integration is better and easier. Here are sample <navigation> from one of my own plugins... Code:
<navigation> <tab name="aptab_competition" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>member</show> <scripts>apcompetition</scripts> <displayorder>30</displayorder> <url><![CDATA[apcompetition.php{session.sessionurl_q}]]></url> </tab> <link name="aplink_enter" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>member</show> <parent>aptab_competition</parent> <displayorder>20</displayorder> <url><![CDATA[apcompetition.php{session.sessionurl_q}]]></url> </link> <link name="aplink_search" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>member</show> <parent>aptab_competition</parent> <displayorder>40</displayorder> <url><![CDATA[apcompetition.php?{vb:raw session.sessionurl}do=search&apmycomps=1]]></url> </link> <link name="aplink_performance" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>member</show> <parent>aptab_competition</parent> <displayorder>60</displayorder> <url><![CDATA[apcompetition.php?{vb:raw session.sessionurl}do=performance]]></url> </link> <link name="aplink_fame" date="1337135420" username="APcompetition" version="3.0.0"> <active>1</active> <show>apmgtug</show> <parent>aptab_competition</parent> <displayorder>80</displayorder> <url><![CDATA[apcompetition.php?{vb:raw session.sessionurl}do=finalvotereport]]></url> </link> </navigation> Code:
<phrasetype name="GLOBAL" fieldname="global"> <phrase name="vb_navigation_tab_aptab_competition_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[Competitions]]></phrase> <phrase name="vb_navigation_link_aplink_enter_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[Enter a Competition]]></phrase> <phrase name="vb_navigation_link_aplink_search_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[Search Competitions]]></phrase> <phrase name="vb_navigation_link_aplink_performance_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[My Performance]]></phrase> <phrase name="vb_navigation_link_aplink_fame_text" date="1336964077" username="APcompetition" version="3.0.0"><![CDATA[Hall of Fame]]></phrase> </phrasetype> Pull down menu's can also be coded. Have a look at the vB source for examples. Specifically "./install/vbulletin-navigation.xml" |
#32
|
|||
|
|||
Quote:
But, I'm not the one who classifies these things. |
#33
|
||||
|
||||
Not odd at all - the core isnt an add-on, other products are.
|
#34
|
||||
|
||||
A few points involving 4.2.1
Dont use the navbar_after_links or navbar_after_sublinks template hooks. They were supposed to have been removed, and will probably go in 4.2.1. These two hooks are likely to disappear as well - collapse_navigation_state, expand_navigation_state The reason they existed was because the bit definitions for the state field were not defined in the vb bitfield file (long story), so the hooks were there to cope with any custom ones. However, another change due in 4.2.1 is to convert the state field to use bitfields defined in the vb bitfield file, so it will not be necessary to use any hooks to add to them. Also, 4.2.1 should see all the Nav Man functions moved out of functions.php into their own file, making it easier to find, update or replace them in the future. |
#35
|
||||
|
||||
Quote:
What hooks do we use then if we want to add our own sublinb menu? I have one that uses the vb:each to get the post days for searching and I can't use the navigation manager to add that sub-menu. |
#36
|
||||
|
||||
For those who may be looking on just how to change the default page off of the Activity Stream and back to the CMS or Forum check out this thread: https://www.vbulletin.com/forum/show...t-Tab-in-4-2-0
|
Благодарность от: | ||
nhawk |
#37
|
||||
|
||||
I'm wanting to create a tab called "Special Access", with sub-links that will go to my library, jukebox, etc. There is not any base page to associate it with. It's just a tab with the sublinks. How the heck do I do this?
Lynne indicated I " will require a plugin to define that tab as active.: Could someone please assist with this? |
#38
|
||||
|
||||
If there's no page what page will show when someone clicks on it?
|
#39
|
||||
|
||||
That's just where I'm messed up, I don't know what kind of page I can make or place there.
Something tells me I'm not going to be able to do this. |
#40
|
||||
|
||||
Its perfectly possible to have a tab with no target url defined, so its just to present a set of links.
However, bear in mind that no link will mean the system redirects you to your site default, so you may want to direct it (the tab) to something like forum.php. |
#41
|
|||
|
|||
Quote:
Quote:
I've tried everything I can think of with the navigation manager with no success. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|