hello, what's the sure fire way to conditionally show something (an image, word, text,etc) based on whether information is filled out in a custom field. For example, we have a custom text field called 'id'. If this 'id' is blank, don't display the image. Else if filled, display the image.
I can't seem to find reference for this. Similar to the 'hide', i guess. Please point me in the right path. Thanks!
Paul, I just previewed this message and got the below. Not sure exactly what I typed to get it. Couldn't find an unused name for . There's got to be a bug in this script if you see this. (Find me in filefunctions.php)
freshwill, there's no logic to multiple elses and there's no else if construction, though you can use PHP for that and mixing PHP with conditionals is fine.
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on Conditionals based on custom field..
Member
Usergroup: Customer
Joined: Sep 30, 2005
Total Topics: 7
Total Comments: 20
hello, what's the sure fire way to conditionally show something (an image, word, text,etc) based on whether information is filled out in a custom field.
For example, we have a custom text field called 'id'. If this 'id' is blank, don't display the image. Else if filled, display the image.
I can't seem to find reference for this. Similar to the 'hide', i guess. Please point me in the right path. Thanks!
Forum Regular
Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan
Total Topics: 57
Total Comments: 185
Seems like you would have problems if you made a field called "id"
But as an example if you made a custom link field called "customid" then the below would work.
<IF {LINKCUSTOMID}>
This appears if there is something in the field
<OTHERWISE>
This appears if there is nothing there
</IF>
Member
Usergroup: Customer
Joined: Sep 30, 2005
Total Topics: 7
Total Comments: 20
Thanks, for some stupid reason, I was using:
<IF {LINKCUSTOMID} is greater than 0>
This appears if there is something in the field
<OTHERWISE>
This appears if there is nothing there
</IF>
Using an example on the displaylinks.tpl page.
This gave me errors. But your way helped. Thanks!
Member
Usergroup: Customer
Joined: Sep 30, 2005
Total Topics: 7
Total Comments: 20
how about this one...
<IF {LINKCUSTOMID}>
show A
<else>
show b
<else>
show c
<else>
show d
</if>
is <else> = <otherwise>? And would a conditional like this work by stackin <otherwise>?
Forum Regular
Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan
Total Topics: 57
Total Comments: 185
Notice the bottom example
scripts.webmastersite.net/w...inks/wsnmanual/articles/69
Paul, I just previewed this message and got the below. Not sure exactly what I typed to get it.
Couldn't find an unused name for . There's got to be a bug in this script if you see this. (Find me in filefunctions.php)
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
freshwill, there's no logic to multiple elses and there's no else if construction, though you can use PHP for that and mixing PHP with conditionals is fine.