drupal code snippits

I do a lot of my freelance work with drupal these days.
I recently came across the need to significant modify the header area of a site…

I had to figure out how to get this to work, but someone else did most of the labor.

Drop this in your template.php file


function THEMENAME_preprocess_page(&$variables) {
if ($variables['node']->type == "my_content_type") {
$variables['template_files'][] = 'page-node-my_content_type';
}
}

replace “THEMENAME” with the name of your theme, and now you can create “page-node-NODETYPE.tpl.php” files to your hearts content.

I got this from http://drupal.org/node/223440

(yeah, now I have to migrate my blog to drupal ;)

This entry was posted in dev and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>