/**
 * Implementation of hook_preprocess.
 * 
 * Since it is difficult to properly determine the path of a theme and subthemes 
 * when the system is offline, the specific preprocess funtion for the 
 * maintenance_page hook is called directly.
 * 
 * @param $vars
 * @return Array
 */
function canvas_preprocess_maintenance_page(&$vars) {
  $vars['body_attributes']['id'] = 'maintenance-page';
  
  $vars['body_attributes']['class'][] = $vars['body_classes'];
  
  $vars['attributes'] = theme('render_attributes', $vars['body_attributes']);
}

Why is this needed?

Comments

Zarabadoo’s picture

Status: Active » Closed (works as designed)

This is to give id and classes to the maintenance page template. Unfortunately, preprocess does not seem to go through the same preprocess as other template files, so I had to separate it out.

jurriaanroelofs’s picture

oh, it's probably because drupal_get_path('theme', 'canvas') doesn't work in offline mode right? Yeah that makes sense then. Thx.