Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shs 5134 photo album aria #1404

Merged
merged 4 commits into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{#
/**
* @file
* Default theme implementation to display a formatted colorbox image field.
*
* Available variables:
* - image: A collection of image data.
* - url: An URL the image can be linked to.
* - attributes: Link attributes.
*
* @see template_preprocess_colorbox_formatter()
*
* @ingroup themeable
*/
#}

{# set a generic link label in case there is no alt attribute on the image #}
{% set link_label = "Open image in the gallery" %}

{# If the image has an alt attribute, use it in the link label. #}
{% set alt_text = image['#alt'] %}

{% if alt_text %}
{% set link_label = "Open " ~ alt_text ~ " image in the gallery" %}
{% endif %}

<a href="{{ url }}" aria-controls="colorbox" aria-label="{{ link_label }}" role="button" {{ attributes }}>{{ image }}</a>