Created
July 7, 2017 15:56
-
-
Save jodyHamilton/5ef3f61d8cc53468f0abd25c1b0656c8 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
<?php | |
/** | |
* Implements template_preprocess_node(). | |
*/ | |
function favorite_preprocess_node(&$variables) { | |
$node = $variables['node']; | |
if ($variables['view_mode'] == 'full') { | |
$variables['#attached']['library'][] = 'favorite/favorite'; | |
$variables['content']['favorite'] = array( | |
'#markup' => '<div id="favorite"></div>', | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment