jasonglisson
2/10/2016 - 7:51 PM

Drupal 7 - Have module load in views templates

Drupal 7 - Have module load in views templates

function NAME_views_api() {
  return array(
    'api' => 3,
    'path' => drupal_get_path('module', 'NAME'),
    'template path' => drupal_get_path('module', 'NAME'),
  );
}
This will tell Views to look in the root directory of your module. I personally am a fan of adding a subdirectory to the module to hold template files. To do this append the directory name to the end of the template path, eg:

'template path' => drupal_get_path('module', 'NAME') . '/templates',