In order to theme a specific page in my site, I created a file called node--2.tpl.php. Per some other tutorials I read, I added this to my template.php file:
function mtheme_preprocess_node(&$vars) {
if (request_path() == 'node/2') {
$vars['theme_hook_suggestions'][] = 'node__2';
}
}
On this page, I wanted the region called schools_landing to be rendered. As such, node--2.tpl.php looks like this and nothing else:
<?php print render($page['schools_landing']); ?>
After doing so, I began seeing the following error messages in the top of the administrator overlay:
Warning: Cannot use a scalar value as an array in include() (line 1 of /home/something/public_html/project/sites/all/themes/mtheme/node--2.tpl.php).
Additionally, I can write text in the node--2.tpl.php file and it displays fine (instead of the default page content), but I can't get blocks to render inside of the region at all. If I assign a block to the schools_landing block, I see nothing on the page.
- Is this the right process to define custom content on a specific page?
- How can I fix the error causing the scalar value as an array error message?
- How can I get my blocks to begin rendering in the region?