Apply condition on particular template I have a template name page--catalogue.tpl.php, I need to add style sheet only for this template. Below is my snippet in my html.tpl.php which only adds class to a particular node whereas I need to add to a whole template. Is there any way?

&lt;?php
if (strtolower ($_GET['q']) == "node/287")
{
?&gt;
&lt;link rel="stylesheet" type="text/css" href="sites/default/files/engine1/style.css" /&gt;
&lt;?php
}
?&gt;
OPTION 1:

If it's a small amount of CSS, maybe considering making your CSS selectors based on the node and including the css in your theme's CSS? Drupal 7 provides the body.page-node-NODEID selector.

OPTION 2:

You could have a look at the Code per Node module. It is also featured in this blog post.


  Code per Node makes it possible to add custom CSS and Javascript per node, per content type, per block, and globally. The code is stored in the database, but served from the file system. It also supports syntax highlighting with CodeMirror.


OPTION 3:

For adding css file to specific content type, you may use this snippet;

function MYTHEME_preprocess_node(&amp;$variables) {
  if(!empty($variables['node'])) {
    if($variables['node']-&gt;type == 'my_custom_content_type')
      {
       drupal_add_css(drupal_get_path('theme', 'MYTHEME') . "/css/foo.css");   
      }
  }

}


OPTION 4:

If you want to add css to specific node then you may use this;

MYTHEME_preprocess_node(&amp;$variables) {
  if ($variables['node']-&gt;nid == 3) {
    drupal_add_css(drupal_get_path('theme', 'MYTHEME') . "/foo.css");
   }
}