Question

Is it possible to have more than one node.tpl.php in Omega/Drupal 7?

For instance, if I wanted the homepage to pull in node.tpl.php (events/articles) but once a "Read more" link is clicked, it goes to something like event.tpl.php or article.tpl.php which formats the content in a different way?

Thanks!

Was it helpful?

Solution

Assuming that the links go to different pages (or different nodes), then yes.

You can define templates all you want down to the field level using the phptemplate system. For example, you could have a page--front.tpl.php, page--node-1.tpl.php, and page--node-2.tpl.php to theme specific pages, or a node--type.tpl.php to theme nodes of a specific type.

Drupal.org has a list of core theme hook (template) suggestions.

You can also use the Theme Developer module to print out what template is being used for a given part of your site, as well as names of alternative templates you could use. Check out the working with template suggestions guide for more detail.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top