Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imcbride/11ca63c4b2f17f089d46 to your computer and use it in GitHub Desktop.
Save imcbride/11ca63c4b2f17f089d46 to your computer and use it in GitHub Desktop.
<?php
/**
* Prepares variables for node.tpl.php
*
* @see node.tpl.php
*/
function midd_preprocess_node(&$variables) {
$function = __FUNCTION__ . '__' . $variables['node']->type;
if (function_exists($function)) {
$function($variables);
}
}
/**
* Prepares variables for node--page.tpl.php
*
* @see node.tpl.php
*/
function midd_preprocess_node__page(&$variables) {
// Content type specific functionality.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment