I created a page--front.tpl.php successfully.
Is there a similar way to create an instance of node.tpl.php that only gets called by the front page?
That would leave the main node.tpl.php untouched to be used in the rest of the site and content.
I believe you are looking for something like the below. This uses the template_preprocess_node function, and this code belongs in your active theme's template.php file:
function YOURTHEME_preprocess_node ( &$vars ) {
if ($vars["is_front"]) {
$vars["theme_hook_suggestions"][] = "node__front";
}
}
and then create your template file named node--front.tpl.php, empty your site cache, and now you should have a template file for nodes specifically displayed on the front page, while your original node.tpl.php will be used everywhere else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With