Commit 78d05a7d authored by Eric Bremner's avatar Eric Bremner
Browse files

FDSU-1829: Ensuring that images load correctly in homepage banners.

parent 0cb2faa5
......@@ -99,9 +99,17 @@ function uw_virtual_site_homepage_page_alter(&$page) {
<source srcset="' . $banner_large . '" media="(min-width: 769px)">
<source srcset="' . $banner_square . '" media="(min-width: 480px)">
<source srcset="' . $banner_large . '" media="(min-width: 320px)">
<source srcset="' . $banner_large . '">
<img src="' . $banner_xl . '" alt="' . $banner_alt . '">
</picture>';
<source srcset="' . $banner_large . '">';
// If the first image, make visible, otherwise make invisible.
if($pagenumber == 1) {
$html .= '<img src="' . $banner_xl . '" alt="' . $banner_alt . '" class="element-selected">';
}
else {
$html .= '<img src="' . $banner_xl . '" alt="' . $banner_alt . '" class="element-invisible">';
}
$html .= '</picture>';
// If there is a title, double check, and then set the caption.
if(isset($page['uw-virtual-site-homepage']['field_uw_homepage_banners'][$index]['entity']['field_collection_item'][$fc_id]['field_uw_homepage_banners_image'][0]['#item']['title'])) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment