This module is perfect. It basically does what I want, but the wrong way :-\

Does anyone know if it's possible to have an inverse option on this module, so that:

If I have a CCK field that isn't empty (named 'info_body' - a recursive field, so I can't use a re-write in this instance), I can add field above (named 'info_title') using this module that will only display content if the other field 'info_body' has something in it?

Thanks,
Craig

CommentFileSizeAuthor
#4 views_ifempty-reverse-1554080-4.patch3.09 KBbenclark
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pcambra’s picture

Interesting, we could add a "negate" option :)

craigperks’s picture

If you could that would be great :)

tr33m4n’s picture

+1 for negate, subscribe

benclark’s picture

Issue summary: View changes
FileSize
3.09 KB

I put together a patch for a "reverse" function. If I could get someone to review this, I'll commit it to the 7.x-1.x branch. The behavior is as follows:

  • Normal behavior:
    • If emptyfield is empty, display outputfield.
    • If emptyfield is not empty, display emptyfield.
  • Reverse behavior:
    • If emptyfield is empty, display nothing.
    • If emptyfield is not empty, display outputfield.

If I've misunderstood the use case or the meaning of the inverse/reverse request, let me know.

benclark’s picture

Status: Active » Needs review
pcambra’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

  • benclark committed c8b4045 on 7.x-1.x
    Issue #1554080: Add reverse function to show outputfield only if...
benclark’s picture

Assigned: Unassigned » benclark
Status: Reviewed & tested by the community » Fixed

Committed to 7.x-1.x branch.

P2790’s picture

Thanks Ben, really helpful

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.