Quote:
Originally Posted by webmastershome
but in postbit i have no value
i am using below
<if condition="!$post['my_variable']">
$post[my_variable]
</if>
|
Ok, there are a couple of things wrong with this which is why it isn't working.
- A '!' means 'not' so what you are actually doing here is telling it that if it is not to post my_variable then you want it to post my_variable. So it is reading the if condition and ignoring it as it doesn't want to not to post it. Sounds confusing? Think how your poor site feels

- If you are using a profile field that you have created as per your first post, then you do not need to use a different variable to call it. You simply use [fieldx] where x is the number assigned to the profile field in the profile field manager.
So you should use
Code:
<if condition="$post[fieldx]">
$post[fieldx]
</if>
Make sure you replace both instances of x with the field number, found as detailed in point #2 above.
If you wish to add a label before the contents of the field, simply add this text before the middle line of code and ensure you leave a space, otherwise it will all run into one.