![]() |
Navbar Template Conditionals Help
Hi all,
Looking for some conditionals that correspond to the navbar template. Example If I am on showthread page, I would like to call the title of thread (first post) in the navbar. Something like this Code:
<vb:if condition="THIS_SCRIPT == 'showthread'"> Or if it needs a plugin? Thanks Mick |
I'd have to test it to be sure, but you could try {vb:raw GLOBALS.threadinfo.title}
|
I think vbulletin.org was lagging earlier as I replied to this?
That worked perfect, I have tried to thank you in the last two posts where you have helped me but it says I cannot thank you because you was the last person I thanked... just shows how helpful you are :) Thank you very much for the code. Mick |
Thanks. Looking at it again, you might want vb:raw instead of vb:var - I was thinking you should handle any html tags, but the SHOWTHREAD template uses vb:raw so it must be handled elsewhere.
|
Cheers, I changed it to raw :)
Can I ask what the difference is as both worked ? Just for future reference. Regards Mick |
The only difference is that 'var' will run the value through htmlspecialchars(), which encodes html characters like '<' and '>' (as < and >) so that they will appear as '<' and '>' in the output. Otherwise they would act as html tags, so if someone were to put html tags in the thread title they could affect the look of your page.
I have to admit I don't know offhand how it's handled - maybe those characters aren't allowed at all in thread titles or something. But you could do a test by creating a thread with a title like '<b>Bold</b>' and then see if vb:raw looks different than vb:var. Edit: I just went ahead and tried it. If you create a thread with title '<b>Bold</b>' and use vb:var you get <b>Bold</b>, which means that htmlspecialchars is being applied twice. So you need to use vb:raw in this case, or you might end up with strange things like that. |
All times are GMT. The time now is 03:04 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:
|