Skip to content

Instantly share code, notes, and snippets.

@sivaji
Created January 25, 2012 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sivaji/1675931 to your computer and use it in GitHub Desktop.
Save sivaji/1675931 to your computer and use it in GitHub Desktop.
Adding css in view page
/**
* Implements hook_views_pre_render().
*/
function example_views_pre_render(&$view) {
$deals_view = array('deals', 'previous_deals');
if (in_array($view->name, $deals_view)) {
drupal_add_js(drupal_get_path('module', 'td_deals') . '/td_deals.js');
$contextual_module_path = drupal_get_path('module', 'contextual');
drupal_add_js($contextual_module_path . '/contextual.js');
drupal_add_css($contextual_module_path . '/contextual.css');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment