benjaminkott / benjaminkott/bootstrap_package

Alternative text attribute not rendered on png icons

Open
#1,531 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
355
Forks
212
Avg merge
1h 4m
Merged PRs (30d)
31

Description

# Bug Report

## Prerequisites

* [n/a ] Can you reproduce the problem on TYPO3 v11.5 LTS
not tried

* [n/a ] Can you reproduce the problem on TYPO3 v12.4 LTS
not tried

* [Y ] Can you reproduce the problem on TYPO3 v13.4 LTS
Yes

* [ Y] Did you [perform a cursory search](https://github.com/issues?q=is%3Aissue+user%3Abenjaminkott+repo%3Abenjaminkott%2Fbootstrap_package)
to see if your bug or enhancement is already reported?
Yes

## Description

When using the 'Text and Icon' content element with an icon that is a png file, there is an option to enter accessibility information: Alternative text and Caption (and also download file name). When these fields are populated and saved in sys_file_metadata they are not rendered in the front end i.e. bug.

An alt attribute is recommended/required for images which give information rather than being purely decorative. Icons may be used as navigational pointers so I think it is correct to enable these attributes but it seems a bug that they are not rendered.

Also, there is no option to enter accessibility information when the icon file is from an iconset

Additionally, I notice that the icon img tag includes aria-hidden="true". But where an icon is used for informational purposes, e.g. as an indication of the content of the content element, that seems inappropriate and perhaps should be configurable rather than a fixed value.

## Steps to Reproduce

1. Starting from default bootstrap_package installation, change one of the text+icon elements on the home page to use a png icon.
2. After saving the change, edit the icon tab of the element to access the Accessibility panel and add the Alternative text.
3. Save and clear caches, then view the page.
4. Inspect the source of the page and it is clear that there is no alt attribute rendered in the img tag

### Expected behavior

The Alternative text entered in the backend should be rendered on the page in an alt attribute for the img tag.

### Actual behavior

The img tag is rendered and the png icon displayed, but the img tag does not have an alt attribute

### Screenshots

n/a

## Versions

TYPO3 13.4.0
bootstrap_package 15.0.0

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Text and Icon content element and follow how PNG icons are rendered in the frontend, reproducing the issue on TYPO3 13.4 with the default bootstrap_package installation. Done means the saved Alternative text appears as an alt attribute on the PNG icon, with the related aria-hidden behavior considered consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
bootstrap, php
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.