function field_group_field_attach_view_alter in Field Group 7
Same name and namespace in other branches
- 7.2 field_group.module \field_group_field_attach_view_alter()
Implements hook_field_attach_view_alter().
File
- ./
field_group.module, line 286 - Fieldgroup module.
Code
function field_group_field_attach_view_alter(&$element, $context) {
// Check whether the view mode uses custom display settings or the 'default' mode.
$actual_mode = 'default';
if (isset($element['#entity_type']) && isset($element['#bundle'])) {
$view_mode_settings = field_view_mode_settings($element['#entity_type'], $element['#bundle']);
$view_mode = $context['view_mode'];
$actual_mode = !empty($view_mode_settings[$view_mode]['custom_settings']) ? $view_mode : 'default';
field_group_attach_groups($element, $actual_mode);
}
}