I have a style plugin, 'mystyle'. And I created a view, 'myview', with style set to 'mystyle'.
Here is the declaration of 'mystyle' in hook_view_plugins:
function mymodule_views_plugins() {
$plugins = array(
'module' => 'mymodule',
'style' => array(
'mystyle' => array(
'title' => t('My Style'),
'handler' => 'mymodule_views_plugin_mystyle',
'theme' => 'mymodule_views_plugin_mystyle_template',
'uses fields' => TRUE,
'uses row plugin' => FALSE,
'uses options' => TRUE,
'uses grouping' => FALSE,
'type' => 'normal',
'even empty' => FALSE,
),
)
);
return $plugins;
}
I have the following files in mymodule/views:
(handler) mymodule_views_plugin_mystyle.inc
(template associated with this style) mymodule-views-plugin-mystyle-template.tpl.php
(template associated with this style, and customized for the view 'myview') mymodule-views-plugin-mystyle-template--myview.tpl.php
My problem: Views is using the first, less specific, template (mymodule-views-plugin-mystyle-template.tpl.php) to display this view.
When I edit 'myview' and click on "theme information", I see both templates listed under "style output":
- mymodule-views-plugin-mystyle-template.tpl.php
- mymodule-views-plugin-mystyle-template--myview.tpl.php
The first, less specific, template is in bold. If I understand correctly, this means that views found the first template but did not find the second.
I have tried rescanning, but that does not help. I have also tried deleting the cache.
Should this work? What do I need to do to get views to find the more specific template?