0

Till now I only used the theme folder to overwrite specific view templates. In order to be able to separate code from theming and bundle functionality I would like to put this view template into a custom module using features.

I guess there won't be a direct way to do this in features itself but that wont be the main problem here.

1 Answer 1

3

You can define the views template path directly within your module (following assumes views 2.x):

/**
 * Implementation of hook_views_api().
 */
function mymodule_views_api() {
  $path = drupal_get_path('module', 'mymodule');
  return array(
    'api' => 2.0,
    'path' => $path,
    'template path' => $path . '/templates',
  );
}

Check out the API documentation built into views for adding templates into your module: http:///help/views/api-default-views (<-- requires advanced help module)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.