Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
wcms-openscholar
uw_virtual_site_homepage
Commits
78d05a7d
Commit
78d05a7d
authored
Jan 24, 2017
by
Eric Bremner
Browse files
FDSU-1829: Ensuring that images load correctly in homepage banners.
parent
0cb2faa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
uw_virtual_site_homepage.module
uw_virtual_site_homepage.module
+11
-3
No files found.
uw_virtual_site_homepage.module
View file @
78d05a7d
...
...
@@ -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'
]))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment