PDA

View Full Version : How can I use a hook in a nav tab's title?


Jeremy8
06-17-2012, 08:45 PM
I have asked this before, but no one seems to be able to help me.

I was okay before 4.2 because I could order nav tab templates via template hooks, but now it only has hooks for before or after manager tabs.

cellarius
06-17-2012, 08:47 PM
Those hooks are deprecated and will go in future versions. Use the new navbar manager instead.

Jeremy8
06-17-2012, 09:15 PM
Those hooks are deprecated and will go in future versions. Use the new navbar manager instead.

I don't think you understood my question. I want to use a hook in a tab's title because it contains information that changes. To be more specific, the tab is for a chat room and the hook is the number of users in the chat. So if there are 8 people in the chat, the tab will say "Chat: 8".

kh99
06-17-2012, 11:27 PM
I think you could use a plugin on hook build_navigation_array, and at that point there's an array called $result with the info for each tab. If you have your tab "Identity" value, you can change $result[$identity]['text'] to whatever text you want.

Edit: That plugin will also be called when you go to the Navigation Manager in the adminCP, so make sure you don't do anything that won't work there. You might want to check VB_AREA == 'AdminCP' and not do anything if that's true.