drupaldrupal-templates

Different templates for a content type inside and outside a view


I have prepared two different templates for Article content type nodes. I would like to use one of the templates in the front page (and show them inside a View, as an unformatted list), and the other template in the rest of the site (outside a View).

I can just define node--article.tpl.php for all the articles, but I have no idea to define another one for the some nodes when they are part of a view (or inside the front page, I don't matter what to use to differentiate both).


Solution

  • I finally learnt a lot more about Drupal 7 and the proper way to do it is (without any code, just using proper names for template files):