Skip to content

Instantly share code, notes, and snippets.

@heyMP
Created December 31, 2013 19:32
Show Gist options
  • Save heyMP/8201204 to your computer and use it in GitHub Desktop.
Save heyMP/8201204 to your computer and use it in GitHub Desktop.
Adding a class attribute to an image in the render array.
sportsmans_hub_omega_preprocess_node(&$variables) {
$variables['content']['field_giveaway_image'][0]['#item']['attributes']['class'] = 'logo';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment