0

I am building a drupal theme from scratch and I encountered a problem - when trying to theme a node by content type <?php print render($content); ?> gives me nothing. My template.php file:

<?php
function etalonestate_preprocess_page(&$vars) {
    if (isset($vars['node']->type)) {
        $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type;
    }
}
?>

Thanks in advance :)

Linas Vainoras
  • 79
  • 1
  • 2
  • 6

1 Answers1

0

In your tpl file, where you want to render($content) you have to put near first lines:

hook_preprocess_page();

Hope this helps.

p.tamas
  • 61
  • 1
  • 4
  • Added the code you suggested in page--property.tpl.php. Got Fatal error: Call to undefined function hook_preprocess_page() – Linas Vainoras Dec 13 '13 at 15:11
  • I think then you have to put it to your node.tpl.php. But i am sure that line will be requied. If this does not work, you have to replace "hook" to your own template name like mytemplatename_preprocess_page() – p.tamas Dec 13 '13 at 15:19