0
votes

I've create a nodequeue and set the "Description / Tag" in the Defaults section to "Entertainment Highlights" and when I click to view Theme: Information it has a template suggest for style output of

views-view-list.tpl.php
views-view-list--nodequeue-91.tpl.php
views-view-list--entertainment-highlights.tpl.php
views-view-list--default.tpl.php
views-view-list--nodequeue-91--default.tpl.php

This looked great because I was hoping to make a template in my theme for views-view-list--entertainment-highlights.tpl.php which wouldn't tie it to a particular nodequeue (building on dev and when I come to put live the nodequeue ID will likely have changed) however when I create the file on the file system and click rescan it doesn't highlight that template name suggesting drupal is not finding it.

If I create a file called views-view-list--nodequeue-91.tpl.php then this works fine and if I change the "Description / Tag" to simply "Entertainment" and create a views-view-list--entertainment.tpl.php file then this is also picked up by drupal so the issue looks like it's tied to spaced in the "Description / Tag" name

Does anyone have any ideas what I need to update to get the template to work. I realise it's likely to be a core tweak but it would be really helpful if it could handle cases like these.

1

1 Answers

0
votes

I found this was not related directly to Drupal6 but instead was related to the OpenPublish variation we are using.

Turns out there is a function called _views_theme_functions() in /sites/modules/views/themes/theme.inc (not to be confused with /includes/theme.inc) which is using the following to determine the name of the theme templates

$themes[] = $hook . '__' . preg_replace('/[^a-z0-9]/', '-', strtolower($view->tag));

However if you examine $themes you can see all the non a-z0-9 characters have been replaced with underscores rather than dashes so needed to amend it to

$themes[] = $hook . '__' . preg_replace('/[^a-z0-9]/', '_', strtolower($view->tag));

I realise this is a core amendment and ideally I wouldn't make this change here.