Field Formatter: how to know where "i'm" 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?
A Field Formatter has no awareness of when it's used. It's simply just a unique way to display a field.

You want to use something like Entityreference ViewMode Selector. And create 2 formatters for the Field Collection. 1 formatter is the default output for collections, 1 formatter is the viewed as entityreference formatter.

When you set the entityreference, you would set the formatter as needed.