Skip to content

Instantly share code, notes, and snippets.

@ewillhite
Created November 13, 2013 21:46
Show Gist options
  • Save ewillhite/7456993 to your computer and use it in GitHub Desktop.
Save ewillhite/7456993 to your computer and use it in GitHub Desktop.
Views Pre-render to add files
<?php
// Views Pre-Render Function
function YOUR_THEME_views_pre_render(&$view) {
if($view->name == 'VIEW_MACHINE_NAME') {
if ($view->current_display == 'VIEW_DISPLAY_MACHINE_NAME') {
drupal_add_js(drupal_get_path('theme', 'YOUR_THEME') .'/js/SPECIFIC_VIEW.js');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment