I have a node type called fotogallery. In this node type there is a field of type "field collection". With hook_field_formatter_view() I create a custom output for this field.
Now, the same node type is linked to another node type via entity reference. In this case I want to create another type of output for the "field colletion" field. But how I (drupal cms) can know if I'm inside node type "fotogallery" or I'm inside an entity reference ?
Do I need to load the current node (via node_load(arg(1)) and see the "type" value?