I've created a custom field formatter which works correctly. My problem is that I want to differentiate its output depending on whether it's being used in a
teaser view mode.
The hook_field_formatter_view doesn't seem to provide this.
One way I can solve this is by providing a setting on that formatter (hook_field_formatter_settings_form) with possible values
teaser. I'd then have to go to the teaser view mode of all content types and configure this setting on all uses of that formatter. I'd then be able to get the setting using
$display['settings']. This would work but it's a bad solution since it would be replicating data that is already there and it also requires administrative work.
Is there a cleaner solution to this?