Created
February 25, 2017 07:03
-
-
Save DejanBelic/c8a86edc4e4ce2cdc4f8e6dd83f78a66 to your computer and use it in GitHub Desktop.
Add class to specific article in drupal 8.
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
function my_theme_preprocess_node(&$variables) { | |
if (($variables['elements']['#attributes']['data-history-node-id']) == 10) { | |
$variables['attributes']['class'][] = 'about-us-'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment