Skip to content
Snippets Groups Projects
Commit 90b08653 authored by Brian Canini's avatar Brian Canini
Browse files

Merge branch 'lee5151' into 'main'

Add hook to add a11y text to file media

See merge request !159
parents 8d3daa53 19714f20
No related branches found
No related tags found
1 merge request!159Add hook to add a11y text to file media
......@@ -1141,3 +1141,17 @@ function asc_bootstrap_bux_preprocess_views_exposed_form(&$variables)
}
}
}
/**
* Appends accessible text to File media when it opens in a new tab.
*/
function asc_bootstrap_bux_preprocess_file_link(array &$variables)
{
$link = $variables['link'];
$attributes = $link->getUrl()->getOption('attributes');
if (isset($attributes['target']) && $attributes['target'] === '_blank') {
$string = $link->getText();
$string .= " (opens in a new window)";
$link->setText($string);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment