Hello.

I'm looking for something like node_type_get_names but for view_mode. Is there any function?

Thanks

Oskar

Comments

Here is what I use to get all

Here is what I use to get all the view modes for an entity type. Depending on the context you may want to filter by bundle.

$entity_info = entity_get_info($entity_type);
$view_modes = $entity_info['view modes'];

Thanks nevets. Oskar

nobody click here