<?php

/**
 * @file
 * Functions to support theming page layout in the Toc Master theme.
 */

use Drupal\node\NodeInterface;

/**
 * Implements hook_preprocess_HOOK().
 */
function toc_wmr_preprocess_page(&$vars) {
  if ($vars['is_front']) {
    $vars['main_classes'] = '';
  }
  $node = \Drupal::routeMatch()->getParameter('node');

  // Proceed only if we are on a node page that is an instance of NodeInterface.
  if ($node instanceof NodeInterface && $node->bundle() == 'destination') {
    $vars['header_class'] = empty($vars['header_class']) ? 'header-static no-minify' : $vars['header_class'] . ' header-static no-minify';
  }
}
