[development] Naming a module's view template

jeff at ayendesigns.com jeff at ayendesigns.com
Mon Oct 11 05:16:45 UTC 2010


And here I was worrying about the naming (my reference to thinking it hadn't changed) -- I thought I had heard that the need for explicit file entries removed the need for the hook. <Buzzer> wrong!  Thanks!
Ayen Designs - quality software the first time, every time!

-----Original Message-----
From: Earl Miles <merlin at logrus.com>
Sender: development-bounces at drupal.org
Date: Sun, 10 Oct 2010 21:45:01 
To: <development at drupal.org>
Reply-To: development at drupal.org
Subject: Re: [development] Naming a module's view template

On 10/10/2010 3:49 PM, jeff at ayendesigns.com wrote:
> Checking to make sure I'm not having a 'moment' and forgetting
> something. This regards Views in D7, but I don't think this has changed
> since D6.
> 
> 
> I have my_module, and it is to have a file that in a non-module
> environment would be views-view-table--my-view--page-1.tpl.php
> 
> 
> In my_module/theme I created my_module-view-table--my-view--page-1.tpl.php
> 
> 
> In my_module.info I have files[] =
> theme/my_module-view-table--my-view--page-1.tpl.php
> 
> 
> The view displays with is table, but no amount of cache clearing seems
> to get this template file recognized.

The answer to this question lies in the advanced help for Views.

Getting your module to provide a theme template for a view is not
automatic. You must register this via hook_theme().


More information about the development mailing list