Add CSS based on View

Date: Feb 24, 2010
User photo
Acquia
Avg. rating:
4.8571428571429
Number of articles: 7
This content applies to the following products:

Using disk-based templates to theme a View you can add a CSS file to your page.

This will add a link in the needed CSS file to your theme.

Paste this code into your Views template file:

<?php
  drupal_add_css
(path_to_theme() . '/myviews.css');
?>

This would be the output in your of your page.

<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/mytheme/myviews.css" />

View an article on theming Views with disk based templates.

4
Your rating: None Average: 4 (2 votes)