I'd like something pretty simple (I think) - just hide a field if it's empty. I can hide a field with this module, but it has to check a different target field. Is it possible to just check a field against itself? The Field Conditions module has the same requirement of checking a field against another field. I can't find any module to hide a field if it is empty. Would it be difficult to add the functionality to this module?

I know hiding a field if it's empty can be done with Views, but we need to not use Views to display this content for a specific reason (it has to do with Workbench and drafts).

CommentFileSizeAuthor
#3 check_field_against_self-2227543-3.patch974 bytesAunion
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikez93’s picture

I could use this as well.

vokabuka’s picture

+1 subscribing

Aunion’s picture

There's actually a variable in the code that decides if the source should be listed among possible targets or not (see line 139 of ffc.ffc_conditions_info.inc). I made a small patch which overrides this (probably not the correct way of doing this, but it was a quick fix), attaching it if someone needs said quick fix.

killingismybusiness’s picture

Firstly i commented in ffc.ffc_conditions_info.inc strings

    if ($field_name == $current_field && $exclude_current_field) {
      continue;
    }

in two places, and then searched for and found this issue.

For performance better to edit or make patch for mentioned file.

P. S.
I installed this module because field formatting module did not hide label for empty fields.

alibama’s picture

#3 doesn't seem to hide the labels... not sure what to do there.....