Skip to content
Snippets Groups Projects
Commit 9979bb0a authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-5880: ensuring that correct media gets set based on user choices

parent 378a2657
No related branches found
No related tags found
3 merge requests!284Feature/istwcms 5880 ebremner banners above,!274Draft: ISTWCMS-5551: fixing office hours display,!260Feature/istwcms 5668 a5kulkar rename references to publications
......@@ -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';
}
}
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment