Drupal 8: Get machine name of a node in template_preprocess_node()
By Phil Frilling, 26 August, 2016
/**
* Implements template_preprocess_node().
*/functionTHEME_preprocess_node(&$variables){
// Return the machine name of the node.
$variables['node']->bundle();
}