Created
December 11, 2013 10:57
-
-
Save marcusx/7908499 to your computer and use it in GitHub Desktop.
How to add a class around.
This file contains hidden or 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
function hook_preprocess_entity(&$variables) { | |
if ($variables['content_element']->type == 'tour_item') { | |
$content_element_wrapper = entity_metadata_wrapper('content_element', $variables['content_element']); | |
$value = $content_element_wrapper->field_text_position->value(); | |
// Add some class to the tour item wrapper. Decide dependent on the value above. | |
$variables['classes_array'][] = 'text-left'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment