PDA

View Full Version : Conditional Syntax


powerbook
09-11-2006, 01:55 PM
Hi,

I created two additional fields in my member profiles

field6: (Nickname) - Single Line text field
field8: (Yes/No) - Radio selection

I would like to give members the option to have a nickname displayed and not displayed if field8 is set to NO in their user profile. I don't know which to use and how to use. I do know where I'd like to add it in the postbit but the conditional is just driving me crazy whatever I do it either display all the syntax or nothing at all..

<if condition="$post[field8]">
OR
<if "$post[field8] = Yes">
OR
if ($post[field8] = Yes)

I've tried to match the syntax in some of the if statements in the postbit but alas, failure..

zappsan
09-11-2006, 07:29 PM
Try this:
<if condition="$post[field8]==Yes">

Adrian Schneider
09-11-2006, 07:35 PM
You should really quote strings or you may run into problems.
<if conditon="$post['field8'] == 'Yes'">

powerbook
09-11-2006, 07:47 PM
Thanks for those replies I'll try and see how it works out :)

EDIT: Thanks a lot that solved my problem!!!