![]() |
Put phrase in navbar link title
Hi, I'd really appreciate someone helping me know how to put a phrase in the link title of a navbar/submenu link. Every time I do it the phrase ({vb:raw num_chatting}) just appears as plain text instead of showing up as I'd like it.
I'm using 4.2 Thanks in advance. |
You can't put in anything other than text. If you wanted to provide translations what you could do is find the phrases that are created for each tab or link then enter the translations there.
But it looks like what you want is for the text to be "dynamic" so you can have it display the current number of people in chat? To do that you could create a plugin using hook build_navigation_data and override the text for a tab or link, like: Code:
$identity = 'link_abc5_abc'; // change this to "Identity" of tab or link |
Thanks for the reply. I tried making that plugin but it just made the link disappear.
Here is the plugin I was originally using: Code:
$result = mysql_query("SELECT * FROM ajax_chat_online"); Code:
<li><a href="/chat/">Chat ({vb:raw num_chatting})</a></li> Thanks again for taking the time. |
Hmm...if your link disappeared then you must have been on the right track. I'd have to see exactly what code you used (did you maybe leave the last line there without actually having created a phrase?).
Sorry, I don't know how you'd go about adding it manually. |
Code:
$identity = 'link_mzg2_354'; // change this to "Identity" of tab or link Ideally I'd like it to appear as Chat (1) [1 being the number of users currently in], pulling the ajax data I posted above. I'm new to this. |
OK, maybe your plugin code could be this (using hook build_navigation_data - and you can disable the other plugin):
Code:
if (is_array($navdata['link_mzg2_354'])) |
It worked! Thanks sooooo much.
|
Quote:
I'm trying to do the same thing but im using 4.1.10 and it doesn't have that hook, is there another way I can do it? Thanks! :) |
All times are GMT. The time now is 10:27 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|