Back to vBulletin 4 Articles

vB4.2 Navigation Manager - how to discussion
by AusPhotography 19 May 2012

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 hope that helps you get a quick leg up for this change.

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>
Sample phrases the give the text of the navigation items.
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>
--------------- Added 19 May 2012 at 04:31 ---------------

Pull down menu's can also be coded.
Have a look at the vB source for examples.
Specifically "./install/vbulletin-navigation.xml"

Similar Mods

Administrative and Maintenance Tools Navigation Manager Enhancements vBulletin 4.x Add-ons

vblts.ru supports vBulletin®, 2022-2024