I need to print some word if a field (from a CCK content) is not empty. I tried many thing but nothing works.
Suppose my field name is "mydrupalfield", could you help me to write a wright syntax ?
Thanx a lot
I need to print some word if a field (from a CCK content) is not empty. I tried many thing but nothing works.
Suppose my field name is "mydrupalfield", could you help me to write a wright syntax ?
Thanx a lot
Comments
Comment #1
emdalton commentedLike this:
First, include your CCK field in your view, but check "exclude from display."
Then, create a Customfield below that, with this code:
if (!$data->mydrupalfield) print 'some word';I don't know exactly how you'll need to reference the field where I've typed "mydrupalfield". Probably something like "node_field_mydrupalfield". See the first documentation link on the main project page for hints on how to find out how to specify fields by name. Direct link: http://drupal.org/node/467190#comment-2068324