Skip to content

Instantly share code, notes, and snippets.

@dherbold
Created October 1, 2017 17:59
Show Gist options
  • Save dherbold/3a72c246f1f9f4c6423da310110ef294 to your computer and use it in GitHub Desktop.
Save dherbold/3a72c246f1f9f4c6423da310110ef294 to your computer and use it in GitHub Desktop.
Various pre processess
<?php
/**
* @file
* Primary pre/preprocess functions and alterations.
*/
function innovationchild_preprocess_page(&$variables) {
if (isset($variables['node']->type)) {
// If the content type's machine name is "my_machine_name" the file
// name will be "page--my-machine-name.tpl.php".
$variables['theme_hook_suggestions'][] = 'page__' . $variables['node']->type;
}
}
function innovationchild_preprocess_html(&$vars) {
$viewport = array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'viewport',
'content' => 'width=device-width, initial-scale=1, maximum-scale=1',
),
);
drupal_add_html_head($viewport, 'viewport');
}
/* function innovationchild_preprocess_panels_pane(&$variables) {
//dpm('type: ' . $variables['pane']->type);
if ($variables['pane']->type == 'fieldable_panels_pane') {
dpm('subtype: ' . $variables['pane']->subtype);
}
}*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment