Skip to content

Commit

Permalink
replace the node function
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuXin committed Jan 3, 2017
1 parent 252a964 commit d0e658c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions node.theme
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
//add stylesheets to a node

function mytheme_preprocess_node(&$variables) {
$node = $variables['node'];
$id = $node->id();
if($id = '26'){
$variables['#attached']['library'][] = 'mytheme/myfont';
$node = \Drupal::routeMatch()->getParameter('node');
if ($node) {
if ($node->id() == 3) {
$variables['#attached']['library'][] = 'mytheme/myfont';
}
}
}

0 comments on commit d0e658c

Please sign in to comment.