Skip to content

Commit

Permalink
LPS-140315 Only add aria attributes when a coverImageCaption exist
Browse files Browse the repository at this point in the history
  • Loading branch information
boton committed Oct 8, 2021
1 parent bb7386e commit 6a1cb30
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
Expand Up @@ -27,7 +27,12 @@ BlogsEntry entry = (BlogsEntry)request.getAttribute(WebKeys.BLOGS_ENTRY);
%>

<c:if test="<%= Validator.isNotNull(coverImageURL) %>">
<div aria-label="<%= HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption())) %>" class="aspect-ratio aspect-ratio-8-to-3 aspect-ratio-bg-cover cover-image mb-4" role="img" style="background-image: url(<%= coverImageURL %>);"></div>

<%
String coverImageCaption = HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption()));
%>

<div <c:if test="<%= Validator.isNotNull(coverImageCaption) %>"> aria-label="<%= coverImageCaption %>" role="img" </c:if> class="aspect-ratio aspect-ratio-8-to-3 aspect-ratio-bg-cover cover-image mb-4" style="background-image: url(<%= coverImageURL %>);"></div>
</c:if>

<%
Expand Down
Expand Up @@ -40,7 +40,12 @@ String entryTitle = BlogsEntryUtil.getDisplayTitle(resourceBundle, entry);
%>

<c:if test="<%= Validator.isNotNull(coverImageURL) %>">
<div aria-label="<%= HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption())) %>" class="aspect-ratio aspect-ratio-8-to-3 aspect-ratio-bg-cover cover-image" role="img" style="background-image: url(<%= coverImageURL %>);"></div>

<%
String coverImageCaption = HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption()));
%>

<div <c:if test="<%= Validator.isNotNull(coverImageCaption) %>"> aria-label="<%= coverImageCaption %>" role="img" </c:if> class="aspect-ratio aspect-ratio-8-to-3 aspect-ratio-bg-cover cover-image" style="background-image: url(<%= coverImageURL %>);"></div>
</c:if>

<%= entry.getContent() %>
Expand Down
Expand Up @@ -31,7 +31,12 @@ String entryTitle = BlogsEntryUtil.getDisplayTitle(resourceBundle, entry);
%>

<c:if test="<%= Validator.isNotNull(coverImageURL) %>">
<div aria-label="<%= HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption())) %>" class="aspect-ratio aspect-ratio-8-to-3 aspect-ratio-bg-cover cover-image" role="img" style="background-image: url(<%= coverImageURL %>);"></div>

<%
String coverImageCaption = HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption()));
%>

<div <c:if test="<%= Validator.isNotNull(coverImageCaption) %>"> aria-label="<%= coverImageCaption %>" role="img" </c:if> class="aspect-ratio aspect-ratio-8-to-3 aspect-ratio-bg-cover cover-image" style="background-image: url(<%= coverImageURL %>);"></div>
</c:if>

<%= entry.getContent() %>
Expand Down
Expand Up @@ -140,7 +140,12 @@ BlogsPortletInstanceConfiguration blogsPortletInstanceConfiguration = BlogsPortl

<c:if test="<%= Validator.isNotNull(coverImageURL) %>">
<a href="<%= viewEntryURL.toString() %>">
<div aria-label="<%= HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption())) %>" class="aspect-ratio aspect-ratio-8-to-3 aspect-ratio-bg-cover cover-image" role="img" style="background-image: url(<%= coverImageURL %>);"></div>

<%
String coverImageCaption = HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption()));
%>

<div <c:if test="<%= Validator.isNotNull(coverImageCaption) %>"> aria-label="<%= coverImageCaption %>" role="img" </c:if> class="aspect-ratio aspect-ratio-8-to-3 aspect-ratio-bg-cover cover-image" style="background-image: url(<%= coverImageURL %>);"></div>
</a>
</c:if>

Expand Down
Expand Up @@ -178,7 +178,12 @@ BlogsPortletInstanceConfiguration blogsPortletInstanceConfiguration = BlogsPortl
%>

<c:if test="<%= Validator.isNotNull(coverImageURL) %>">
<div aria-label="<%= HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption())) %>" class="aspect-ratio aspect-ratio-bg-cover cover-image" role="img" style="background-image: url(<%= coverImageURL %>);"></div>

<%
String coverImageCaption = HtmlUtil.escapeAttribute(HtmlUtil.stripHtml(entry.getCoverImageCaption()));
%>

<div <c:if test="<%= Validator.isNotNull(coverImageCaption) %>"> aria-label="<%= coverImageCaption %>" role="img" </c:if> class="aspect-ratio aspect-ratio-8-to-3 aspect-ratio-bg-cover cover-image" style="background-image: url(<%= coverImageURL %>);"></div>
</c:if>

<!-- text resume -->
Expand Down

0 comments on commit 6a1cb30

Please sign in to comment.