How to hide a field in node display if it's value is 0. Drupal 7. -
i using drupal installation rest server android application. store data in nodes , field blank, example location has no phone number. had standardize json coming out of drupal rest server specified class, forced add 0, value in field.. works great in andriod, when viewed on drupal site, looks bad..
so question is, if value of field 0, id change 'none'.
i in d6 cck, dont know d7 field api. thanks
you can in node.tpl.php file, in field.tpl.php file or template_preprocess_field function (recommended) , many other options if statement. see example first template , 1 second option preprocess function.
if don't want edit tpl.php files or don't have access template.php file of theme can use field formatter conditions module allows condition. alternatives custom formatters , field_formatter_css_class.
Comments
Post a Comment