Last active
September 14, 2017 12:41
-
-
Save jasonglisson/f0ee7ccea6d286fbd330 to your computer and use it in GitHub Desktop.
Drupal 7 - Have module load in views templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment