Drupal - Render a View in a Node Template

In this example, we have a content type called Unit (machine name: unit). And we want to programatically render a view on its node template. So we'll do something like this:

1. Create a copy of our theme's default node.tpl.php file and save it as node--[type].tpl.php file in your sites/all/themes/my_theme directory. In this example, a file name of node--unit.tpl.php is correct.

2. Render the view into a theme variable.

Subscribe to RSS - templates