Skip to content

Instantly share code, notes, and snippets.

@anthonyringoet
Created June 14, 2012 10:49
Show Gist options
  • Save anthonyringoet/2929582 to your computer and use it in GitHub Desktop.
Save anthonyringoet/2929582 to your computer and use it in GitHub Desktop.
Make image style links not focusable (fe. when there are other read more links already available)
<?php
/*
* Implements hook_preprocess_image_formatter() to add tabindex to teaser img links
*/
function theme_preprocess_image_formatter(&$vars) {
if ($vars['image_style'] == "yourimagestyle") {
if(!empty($vars['path'])) {
$vars['path']['options']["attributes"]["tabindex"] = -1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment