Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.