Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
4.7.x-1.x-dev
Component:
General
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
21 Aug 2006 at 21:01 UTC
Updated:
22 Aug 2010 at 00:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
karens commentedThis is a theme issue. Read about themeing in the CCK Handbook at http://drupal.org/node/101723.
Comment #2
jpetso commentedWhile it is possible to do this with theming, I feel that this is far more complex and demanding than it should be. The comments at http://drupal.org/node/62485 show that it's not straightforward and especially not for non-coders. I believe that empty fields should be hidden by default, and if it's not hardcoded it should at least be a simple checkbox in the field properties. Oh, and, Flexinode hides them as well.
I hacked a small patch together (for the 4.7 version of CCK's content.module) which hides all empty fields by theming them out in theme_field(). I'm new to Drupal coding, so slap me if I've done it wrong. Or maybe include it into CVS, whatever ;)
Anyhow, please state some use cases where not hiding empty fields would be needed, and the reasons why you think they should be visible by default.
Comment #3
jpetso commented...and reopen the bug with the patch being in here. I'm sorry to go on your nerves this way, but marking it "fixed" this way is just too easy.
Comment #4
yched commentedActually I think we should consider doing this - Would save time to most users and save us much support requests...
Karen, dopry, what do you think ?
Comment #5
karens commentedSure, I have no objection. I guess I was just trying to clean things out of the issue queue that can be done already. Maybe I was too quick to check this one off :-)
As I think about it, I suppose the normal use case would be to not display the label and use themeing if you wanted a different outcome. I've got no time to do this myself right now, but go ahead yched when you have time.
Comment #6
yched commentedYes, will do that :-)
Comment #7
yched commentedcommitted a simpler version to all branches
Comment #8
jpetso commentedThanks a lot!
Just two minor issues with your modifications:
- The last
appended to $output isn't closed:
$output .= '</div';should be
$output .= '</div>';-
if (!empty($items_output))returns the $output string, but there's no return statement in case the condition is false.It would probably be better if there was an
else { return ''; }.I reopened the bug for these issues to be fixed.
Comment #9
yched commentedcorrected - thanks !
Comment #10
(not verified) commentedComment #11
Anonymous (not verified) commentedHi all,
When I install a CCK formatter like cck multiple formatter or cck formatter, blank fields printing their field headers. Specifically, the fields that are printing are those in which I assigned to display as an unordered list (as assigned in the display fields tab).
Can anyone direct me how I might solve this problem?
Tanks!