Skip to content

Commit 8e3d30e

Browse files
fix: ♿ use context title if no banner title is available, remove aria-describedby when there is no description
1 parent 8751017 commit 8e3d30e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/cusy/cms/browser/overrides/collective.behavior.banner.browser.banner.pt

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
tal:define="banner view/find_banner|nothing"
33
i18n:domain="collective.behavior.banner">
44

5-
<aside id="portal-banner" class="banner" aria-labelledby="portal-banner-title" aria-describedby="portal-banner-description"
5+
<aside id="portal-banner" class="banner" aria-label="" aria-labelledby="" aria-describedby=""
66
tal:condition="python: banner"
77
tal:define="has_image python:banner and 'banner_image' in banner;
88
has_url python:banner and 'banner_url' in banner;
99
has_fontcolor python:banner and 'banner_fontcolor' in banner;
1010
fontcolor python:has_fontcolor and banner['banner_fontcolor'] + ' !important' or '#4d4d4d';
1111
has_backgroundcolor python:banner and 'banner_backgroundcolor' in banner;
1212
backgroundcolor python:has_backgroundcolor and 'background:' + banner['banner_backgroundcolor'] + ' !important' or ''"
13-
tal:attributes="style backgroundcolor;">
13+
tal:attributes="style backgroundcolor;
14+
aria-label python: banner.get('banner_title') and None or context.title;
15+
aria-labelledby python: banner.get('banner_title') and 'portal-banner-title' or None;
16+
aria-describedby python: banner.get('banner_description') and 'portal-banner-description' or None;">
1417
<div class="container">
1518
<div class="banner__container"
1619
tal:attributes="class python:'banner__container' if has_image else 'banner__container banner__container--no-image'">

0 commit comments

Comments
 (0)