I've been learning a lot by playing around with the zen theme. I'm trying to create my sub-theme without modifying any of the files for the main theme. One place I ran into a wall was when using the Views Theme Wizard, which is also new to me.

The problem

I have a view called board_list.
I ran the theme wizard and it generated the code for me. (COOL!)
I placed the code where instructed, including creating a file called views-list-board_list.tpl.php
When I tried to bring up the view in the browser, the pager at the bottom of the view indicated that there were three pages of results, but none of the individual results were output. (The page was blank)

The solution

It took me a while to track down, but the solution was very simple:

I moved views-list-board_list.tpl.php into the zen directory, instead of my sub-theme directory, and VOILA! it works.

I'm afraid I don't know this system well enough to offer a real solution, but thought the bug would be good to file.

Comments

JohnAlbin’s picture

Priority: Minor » Critical

The Views theme wizard is very cool.

A zen sub-theme should have all of its files in its own directory. I would consider this a critical bug.

The good news is this is automatically fixed by the theme changes in Drupal 6, but I would like to get this fixed for D5.

OpenChimp’s picture

Yeah. A lot of sites will be built and run on D5 for a long time to come. If you have any ideas of where to start I'd give a shot at fixing this.

JohnAlbin’s picture

Title: _phptemplate_callback for sub-themes doesn't look in the sub-theme directory for .tpl.php files » _phptemplate_callback doesn't look in sub-theme folder for .tpl.php files
Status: Active » Fixed

Woo-hoo! Fixed in 5.x-1.x-dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

JohnAlbin’s picture

Turns out this isn't quite fixed. A patch is require for Views: http://drupal.org/node/215570

JohnAlbin’s picture

Title: _phptemplate_callback doesn't look in sub-theme folder for .tpl.php files » Views Theme Wizard: _phptemplate_callback doesn't look in sub-theme folder for .tpl.php files
Status: Closed (fixed) » Active

Re-opening until a patched Views Theme Wizard is released.

s.Daniel’s picture

The patch works for me. However I want to note that the patch doesn't fix the problem, that the css file is searched in the main theme folder. To fix that you will want to change the drupal_add_css function in your views-list-VIEWNAME.tpl.php from:

  drupal_add_css(path_to_theme() .'/views-list-VIEWNAME.css');

to

  drupal_add_css(path_to_subtheme() .'/views-list-VIEWNAME.css', 'theme', 'all');
JohnAlbin’s picture

Good catch, Sebastian!

We can’t patch Views with call to path_to_subtheme() since that’s a Zen function. Guess I’ll have to add some documentation.

(BTW, I usually delete that drupal_add_css() and just add my css to SUBTHEME.css.)

JohnAlbin’s picture

Status: Active » Fixed

I’m marking this fixed, since I’ve added the fixes to the documentation: http://drupal.org/node/220111

Hopefully, most (but not all) of this will get fixed in Views 5.x-1.7.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.