How to conditionally render fields with a different formatter I have a content type with two fields one called display which is a simple list and the other is an entityreference field.

I would like to change how the entity reference field is rendered depending on which option is selected in the first field.

I have custom formatters installed and I have created two custom formatters so I need a way of changing the #formatter based on the result in the first field.

I've tried a hook_preprocess_node() and also changing it in a custom tpl file but neither seem to render the field any differently to how it is set in the manage field UI.
I would try using the Context module API and adding a new reaction plugin.