Search code examples
drupaldrupal-viewsdrupal-themingdrupal-themes

Drupal theme files outside of theme folder


Is there a place where I can place override theme files other than a theme's folder? For example, if I wanted to override the appearance of a view's row in the same style for more than one theme without having to use more than one file.

If there isn't a generic way to do this (for any theme file), is there a way to do it for a view's theme files?


Solution

  • In your module, you can use hook_theme to declare a theme function or template for your view's row. This way, your single template will be used by all your themes without any special code in them. See the Theming your views in your module section in the Views's API Advanced Help page.