Last active
September 21, 2016 15:40
-
-
Save markconroy/e231d5d337a99f4c3a7bbd868ba389de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_preprocess_HOOK() for paragraph--para-image-text.html.twig. | |
*/ | |
function THEME_preprocess_paragraph__para_image_with_text(&$variables) { | |
$paragraph = $variables['paragraph']; | |
// Get the value of the image style and add it as a class on the image field. | |
$style_image = $paragraph->get('field_para_image_with_text_float')->value; | |
$variables['attributes']['class'][] = $style_image; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment