The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
template condition problem
I want to modify the postbit to show some content based on the user custom field's content.
Here is my code. <if condition="$post['field2'] == XXXX"> <div class="smallfont">Message1</div> <else /> <if condition="$post['field2'] == YYYY"> <div class="smallfont">Message2</div> <else /> Message3 </if> </if> but it only shows Message3 in all conditions. Can anyone help me? FYI, I can show the content of $post[field2] by using <p>$post[field2]</p> Thanks. |
#2
|
|||
|
|||
Code:
<if condition="$post[field2] == 'XXXX'"> <div class="smallfont">Message1</div> <else /> <if condition="$post[field2] == 'YYYY'"> <div class="smallfont">Message2</div> <else /> Message3 </if> </if> |
#3
|
||||
|
||||
It depends if the XXXX and YYYY are numbers, but you can enclose them in quotes either way.
In conditions, array keys should ALWAYS be quoted if they are strings. Read a little bit of this thread, it is a prime example of why... https://vborg.vbsupport.ru/showthread.php?t=120134 |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|