How to detect Panelizer use in template_preprocess_html()? In Drupal 7, you could look for $node-&gt;panelizer or use page_manager_get_current_page() to check if the current page uses a panelizer layout. How do you do that in Drupal 8?

I'm trying to add a body class if the current page contains a specific pane.
I'm not sure if this is quite what you're after, but these hooks will fire if your page is using panelizer.    

/**
 * Implements hook_preprocess_panels_pane().
 */
function YOURTHEME_preprocess_panels_pane(&amp;$$variables) {
  // If this triggers then you are in a panels pane.
}


OR

/**
 * Implements hook_panels_pane_content_alter().
 */
 function YOUR_MODULE_panels_pane_content_alter($content, $pane, $args, $contexts) {
  // If this triggers then you are altering panels content.
}


If you want to check for panelizer in the node you could try something like this:

$node = \Drupal::routeMatch()-&gt;getParameter('node');
if ($node-&gt;hasField('panelizer')) {
  // Do stuff
}