Introducing Field formatter conditions for Drupal

The Field formatter conditions module for Drupal allows you to add conditions and actions per field on the manage display screens of entities (nodes, users etc). For example: you can hide a field on path x. Or hide it when the current user has role 'Administrator'. The module ships with several built-in conditions and actions for common use cases we encountered during projects at work. And thanks to jpstrikesback a couple of more will be added before we hit a 1.0 release.

It's easy to write your own specific use cases for a project, consult the API or look into the code how to built a form, condition and callback yourself in a few minutes. Field API and Display Suite fields are supported, Field API's extra fields are not, and most likely neither in the future.

Rules support

It gets better though. The API is limited to the fact that a callback is both the condition and the action. But what in case you want more conditions ? That's where Rules comes into play. You can build unlimited rules with fancy conditions and then fire off actions on a specific field. Currently, the module ships with two rules actions which can hide a field or change the image style of an image formatter. The event for these rules always needs to be 'A field is rendered'. Depending on the use cases, more will be added later, but it's easy for developers to write their own actions targeted for a specific project.

See it in action

See how it works in a short screencast. Happy conditioning and a very good new year!


Daniel Nolde on Wed, 19/12/2012 - 14:25

Interesting module - a in-depth or small tutorial blog post about it at would be awesome!

S1L on Wed, 19/12/2012 - 14:37

Rules support? Interesting! You're telling we can show/hide a field based on Organic Group subscription? Sounds great!

Tiago Santos on Wed, 19/12/2012 - 18:44

Great module it will save me a lot of time for sure! Thanks for the your work.

Luco on Fri, 28/12/2012 - 11:20

I've been looking for this functionality for a while now. it literally made my jaw drop! gonna take it for a spin ASAP. thank you so much and have a happy new year!

Add reply

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Have you written a response to this? Let me know the URL by sending a webmention.