You are here

function panopoly_widgets_field_display_fieldable_panels_pane_alter in Panopoly Widgets 7

Implementation of hook_field_display_ENTITY_TYPE_alter().

Update the display settings with the option selected on the entity view mode field.

File

./panopoly_widgets.module, line 520

Code

function panopoly_widgets_field_display_fieldable_panels_pane_alter(&$display, $context) {
  if ($context['field']['field_name'] == 'field_existing_content') {
    $view_mode = $context['entity']->field_view_mode[LANGUAGE_NONE][0]['value'];
    if (!empty($view_mode)) {
      $display['settings']['view_mode'] = $view_mode;
    }
  }
}