Skip to content

Commit 3aac300

Browse files
committed
Apply aria-hidden=true on article images if they are purely decorative
Without this change, I have the issue that I cannot access the text content of articles using VoiceOver.
1 parent 8946ff9 commit 3aac300

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

com.woltlab.wcf/templates/article.tpl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@
7070
{unsafe:$__wcf->getReactionHandler()->getDataAttributes('com.woltlab.wcf.likeableArticle', $article->articleID)}
7171
>
7272
{if $articleContent->getImage() && $articleContent->getImage()->hasThumbnail('large')}
73-
<div class="entry__coverPhoto__wrapper" itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
73+
<div
74+
class="entry__coverPhoto__wrapper"
75+
{if !$articleContent->getImage()->caption && !$articleContent->getImage()->title && !$articleContent->getImage()->altText}
76+
aria-hidden="true"
77+
{/if}
78+
itemprop="image" itemscope itemtype="http://schema.org/ImageObject"
79+
>
7480
<figure class="entry__coverPhoto">
7581
{unsafe:$articleContent->getImage()->getThumbnailTag('large')}
7682
{if $articleContent->getImage()->caption}

0 commit comments

Comments
 (0)