diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 1df64992d2a87ab5eda1765012791c96260f27e1..8586bd9dee0a30654839bd41014c2a4dc0258d7b 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -170,6 +170,24 @@ function uw_cfg_common_entity_presave(EntityInterface $entity) { if ($type_of_media == NULL) { $entity->set('field_uw_hero_image', NULL); } + else { + + // If the media type is anything but banner, set it + // to have full width style, otherwise check that it + // can have other things besides full width. + if ($type_of_media !== 'banner') { + $entity->field_uw_media_width = 'uw_lbs_full_width'; + } + else { + + // If the banner is not fdsu (full-width), have the + // style set to full-width. This ensures that we will + // always have full width for things that are not fdsu. + if ($entity->field_uw_text_overlay_style->value !== 'full-width') { + $entity->field_uw_media_width = 'uw_lbs_full_width'; + } + } + } } } }