By hazexp on
I have posted this before, but that was before CCK got support for NULL entries.
Basically, I would like a CCK field to only show (along w/ its title) if the field has any text in it, otherwise it should be removed from the submission.
For example:
Source (title)
_______ (empty field)
With an example such as this I would like it to not be displayed.
Any help on this matter would be much appreciated, thank you for your time.
Comments
Sorry for bumping, but is
Sorry for bumping, but is this possible?
?php if
?php if (!empty($item['view'])) { print "blah"....
Check into contemplate.
How do I use that in
How do I use that in here?
That's what Contemplate gives me.
Start Fresh
Usually contemplate starts by giving you a bunch of stuff you don't want. I'd suggest starting fresh and only putting in the stuff you want, complete with the if/thens that you need.
Ok, how do I start fresh
Ok, how do I start fresh using this?
greeneo (or someone) - did
greeneo (or someone) - did you every figure this out? I have a working node-cck.tpl.php file, but I need the php code to hide fields if they are empty, and I am not quite sure how to complete the "blah" suggestion above. Here is a sample field:
How can I get this to actually hide or simply not display the empty field? - Thanks, Maria
you can try this solution
i think this solution is better for hiding fields
http://www.tejasa.com/node/127
Will this hide the field in
Will this hide the field in all pages it can be shown, or just if I use views?
How do you use it?
This is from the link you posted. I tried putting it in field.tpl.php which has nothing but this code but the fields still displayed.
thanks.
In case it'll help anyone, ...
In case it'll help anyone, check out post 1 of this thread: http://drupal.org/node/79188. Just checking if the field isset, NULL or blank doesn't seem to work. Referencing the field directly in the if statement didn't work well either (for some reason).
The following worked for me:
Thanks
Thanks, that worked perfectly.