I have a field that people enter scores into, and sometimes the score is zero, and sometimes its blank. I want to show the score if it is 0, but not if it is blank. How would I be able to do this since {if field} returns false if 0 is entered in?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
August 24, 2011 5:40pm
Subscribe [3]#1 / Aug 24, 2011 5:40pm
I have a field that people enter scores into, and sometimes the score is zero, and sometimes its blank. I want to show the score if it is 0, but not if it is blank. How would I be able to do this since {if field} returns false if 0 is entered in?
#2 / Aug 24, 2011 7:37pm
Hiya,
Something like this should do what you need if I’m reading your post correctly :
{if score_field != ""}
{score_field}
{/if}You’ll want to change score_field above for whatever the name of your custom field is but that should hopefully get you what you want. Basically the conditional above is just checking for something to be in the field. If nothing has been typed into the field then nothing will be output. If there is something in the field then it will be output which I believe is what you’re after here.
Best wishes,
Mark
#3 / Aug 25, 2011 2:29am
blendimc,
Did Mark’s answer help?
#4 / Sep 02, 2011 9:30pm
Hi blendimc,
Just wanted to see if that worked for you?
Cheers,
Mark