views:

78

answers:

1

hi,

I'm using several CCK Text Area in my content page. The fields are optional, but if I don't fill them, I see them on the page anyway, and the content is
..

i.e.
FieldName: <br />

I would like to make them disappear instead..

I found out the problem is that CCKEditor add a
even if I've never typed in that window. How can I disable this ?

thanks

A: 

You can do as is advised in this post: Hide empty CCK fields from view

// hide empty fields from display
if (!$items[0]['view']) return;

Put this at top of field.tpl.php, which should be copied to your theme folder as per CCK theming documentation.

alxp
well the field is actually not empty.. there is <br /> tag in it
Patrick
There is already the if condition in content-field.tpl.php <?php if (!$field_empty) : ?> I've removed the "!" and indeed all fields disappear. The problem is that the field contains <br /> tag so they are not empty.
Patrick
I've solved with <?php if (trim($items[0]['view']) == '<br />') : ?> in field-content.php in CCK/Themes
Patrick

related questions