Creating a new theme and for some reason, node-blog.tpl.php is not being loaded. This is in a multisite installation. While I have created themes before this one is stumping me.

page-blog.tpl.php is being loaded through a template.php suggestion and works just fine:

  if (module_exists('blog')) {
    if ($variables['node']->type == "blog") {
      $variables['template_files'][] = 'page-blog';  // full page blog entry
    }
  }

But /sites/mysite.com/themes/mytheme/node-blog.tpl.php isn't being loaded.

Any ideas?

Comments

kkobashi’s picture

More....

This isn't being called either:

function foobar_preprocess_node(&$variables) {
  if (module_exists('blog')) {
    if ($variables['node']->type == "blog") {
      $variables['template_files'][] = 'node-blog';
    }
  }
}

Very weird because the existence of node-blog.tpl.php should result in it being loaded - it has in all my previous theme work.

Kerry Kobashi

kkobashi’s picture

Never mind, I figured it out.

You have to have in existence a node.tpl.php file also or node-blog.tpl.php won't load. Don't know why this is the case but it works. Also some fussing with the template.php file is needed.

More here:
http://www.kobashicomputing.com/theme-drupal-blog-nodes

dman’s picture

That's helpful to know.
It might be worth a note in the docs if this is really the case.

.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |