From 9db09cfb71a4ee81e1f752df1abc7c7596cc6296 Mon Sep 17 00:00:00 2001 From: brian teeman Date: Sat, 7 Nov 2020 21:42:00 +0000 Subject: [PATCH] [4.0] tags menu items image alt [a11y] --- administrator/language/en-GB/com_tags.ini | 3 +++ components/com_tags/tmpl/tag/default.php | 5 ++++- components/com_tags/tmpl/tag/default.xml | 14 ++++++++++++++ components/com_tags/tmpl/tag/list.php | 5 ++++- components/com_tags/tmpl/tag/list.xml | 14 ++++++++++++++ components/com_tags/tmpl/tags/default.php | 5 ++++- components/com_tags/tmpl/tags/default.xml | 13 +++++++++++++ 7 files changed, 56 insertions(+), 3 deletions(-) diff --git a/administrator/language/en-GB/com_tags.ini b/administrator/language/en-GB/com_tags.ini index 41142d3e1c305..d5fbb638d06f1 100644 --- a/administrator/language/en-GB/com_tags.ini +++ b/administrator/language/en-GB/com_tags.ini @@ -125,6 +125,9 @@ COM_TAGS_TAG_LIST_DESCRIPTION_DESC="Optional description to show at the top of t COM_TAGS_TAG_LIST_DESCRIPTION_LABEL="Layout Description" COM_TAGS_TAG_LIST_FIELD_ITEM_DESCRIPTION_LABEL="Item Body" COM_TAGS_TAG_LIST_ITEM_DESCRIPTION_DESC="Shows the body text for the individual items (depends on the source table)." +COM_TAGS_TAG_LIST_MEDIA_ALT_EMPTY_DESC="Decorative Image - no description required" +COM_TAGS_TAG_LIST_MEDIA_ALT_EMPTY_LABEL="No Description" +COM_TAGS_TAG_LIST_MEDIA_ALT_LABEL="Image Description (Alt Text)" COM_TAGS_TAG_LIST_MEDIA_LABEL="Image" COM_TAGS_TAG_LIST_SHOW_DATE_LABEL="Date" COM_TAGS_TAG_LIST_SHOW_HEADINGS_LABEL="Table Headings" diff --git a/components/com_tags/tmpl/tag/default.php b/components/com_tags/tmpl/tag/default.php index 5aed2558797ae..2bc10e82b355a 100644 --- a/components/com_tags/tmpl/tag/default.php +++ b/components/com_tags/tmpl/tag/default.php @@ -46,7 +46,10 @@ params->get('tag_list_show_tag_description', 1) || $this->params->get('show_description_image', 1)) : ?> params->get('show_description_image', 1) == 1 && $this->params->get('tag_list_image')) : ?> - + params->get('tag_list_image_alt')) && empty($this->params->get('tag_list_image_alt_empty')) + ? '' + : 'alt="' . htmlspecialchars($this->params->get('tag_list_image_alt'), ENT_COMPAT, 'UTF-8') . '"'; ?> + > params->get('tag_list_description', '') > '') : ?> params->get('tag_list_description'), '', 'com_tags.tag'); ?> diff --git a/components/com_tags/tmpl/tag/default.xml b/components/com_tags/tmpl/tag/default.xml index ccfcf7a881bbe..2d601df206ecc 100644 --- a/components/com_tags/tmpl/tag/default.xml +++ b/components/com_tags/tmpl/tag/default.xml @@ -90,6 +90,20 @@ label="COM_TAGS_TAG_LIST_MEDIA_LABEL" /> + + + + params->get('tag_list_show_tag_description', 1) || $this->params->get('show_description_image', 1)) : ?> params->get('show_description_image', 1) == 1 && $this->params->get('tag_list_image')) : ?> - + params->get('tag_list_image_alt')) && empty($this->params->get('tag_list_image_alt_empty')) + ? '' + : 'alt="' . htmlspecialchars($this->params->get('tag_list_image_alt'), ENT_COMPAT, 'UTF-8') . '"'; ?> + > params->get('tag_list_description', '') > '') : ?> params->get('tag_list_description'), '', 'com_tags.tag'); ?> diff --git a/components/com_tags/tmpl/tag/list.xml b/components/com_tags/tmpl/tag/list.xml index 996d02e10e2bf..547da796e28ca 100644 --- a/components/com_tags/tmpl/tag/list.xml +++ b/components/com_tags/tmpl/tag/list.xml @@ -89,6 +89,20 @@ label="COM_TAGS_TAG_LIST_MEDIA_LABEL" /> + + + + params->get('all_tags_show_description_image') && !empty($descriptionImage)) : ?> + params->get('all_tags_description_image_alt')) && empty($this->params->get('all_tags_description_image_alt_empty')) + ? '' + : 'alt="' . htmlspecialchars($this->params->get('all_tags_description_image_alt'), ENT_COMPAT, 'UTF-8') . '"'; ?>
- + >
diff --git a/components/com_tags/tmpl/tags/default.xml b/components/com_tags/tmpl/tags/default.xml index badc7ce00a353..33206523546c8 100644 --- a/components/com_tags/tmpl/tags/default.xml +++ b/components/com_tags/tmpl/tags/default.xml @@ -74,6 +74,19 @@ label="COM_TAGS_ALL_TAGS_MEDIA_LABEL" /> + + +