Skip to content

Instantly share code, notes, and snippets.

@woombo
Created June 5, 2015 18:47
Show Gist options
  • Save woombo/254e0a6f188236fccd7f to your computer and use it in GitHub Desktop.
Save woombo/254e0a6f188236fccd7f to your computer and use it in GitHub Desktop.
Drupal Features: Allow custom view templates to be placed within feature
<?php
/**
* Implements hook_views_api_alter().
* Alter the list of modules/themes which implement a views api.
*/
function MODULE_views_api_alter(&$list) {
// Alter the path of the views implementation.
if (isset($list['MODULE'])) {
$path = drupal_get_path('module', 'MODULE');
$list['MODULE']['path'] = $path;
$list['MODULE']['template path'] = $path . '/assets/views';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment