Problem/Motivation
In the BEM theme, the home/logo image in the System Branding block uses the default alt text (`home`).
That alt text is not descriptive enough for accessibility and should use contextual site branding text instead: `Logo of {{ site_logo_name }}`.
Steps to reproduce
1. Enable BEM and place the Site branding block.
2. Configure a site logo and site name.
3. View the rendered branding block and inspect the logo image.
4. Note that the logo image alt text is the default (`home`) instead of `Logo of {{ site_logo_name }}`.
Proposed resolution
- Add a BEM override for the branding block template: `templates/block--system-branding-block.html.twig`.
- Add preprocess handling for `system_branding_block` in `bem.theme`.
- Provide a `site_logo_name` variable when logo output is available.
- Set the logo image alt text to `Logo of {{ site_logo_name }}` in the template.
- Keep translatable homepage labels for links.
Remaining tasks
- Verify alt text output with logo + site name configured.
- Verify fallback behavior when logo or site name is missing.
- Verify no regressions in Site Branding block rendering.
User interface changes
Yes.
The Site branding block output is overridden, including logo image alt text.
API changes
No.
Data model changes
None.
Issue fork bem-3592496
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pjotr van der horst commentedComment #5
timohuisman