I'm working with a view "news_admin_list" and am displaying it on a page via:

 $view = views_get_view('news_admin_list'); 
print $view->execute_display('default'); 

From what I understand, someone should be able to override the default template file for a specific view by placing a correctly named file in their active theme directory. I have copy/pasted a lot of the default views.tpl.php files into my current theme and views recognizes and uses them, but for some reason they don't have access to the php variables.

For instance:
File: views-view-table--news-admin-list.tpl.php

 print "<br /><br />This part shows up<br /><br />";
php print_r($row); //this displays nothing
php print_r($header); //neither does this 

So I'm curious if it's a bug or what is going on here? Views obviously recognizes the template file being used, but none of the php variables are assigned? Any ideas?

Thank you.

Comments

merlinofchaos’s picture

Status: Active » Fixed

There is a bug in Drupal core that is mentioned in the help file for the theme: information page; you need to use the Drupal 6-dev until 6.3 comes out; that fixes this problem. (Upon updating to Drupal 6 dev or utilizing the patch, which is linked from said help file (I don't remember the nid offhand or I'd post it here) be sure to clear cache to get all the theme registry stuff to update).

buchannon’s picture

Ah alright. I must have missed that help file. I figured that this is probably a pretty common question here but I searched for about half an hour (google and drupal.org) on it and couldn't find anything.

Thank you for the info.

buchannon’s picture

There is a bug in Drupal core that is mentioned in the help file for the theme: information page;

Well I set out to find the help file you are speaking of and am failing. If you get a chance, could you specify what you mean by the "theme: information page" ? I couldn't find hardly any help pages that were directed towards themes and none of the readme files in the directory contained any information on this either.

Thanks in advance.

merlinofchaos’s picture

On any view, at the bottom of the Basic settings, there is a Theme: information link that gives lots of information about templates. Once clicked on, the ajax area opens up and at the title there will be a help question mark.

The help file is named Theme information within the help tree, as well.

buchannon’s picture

Aha! Thank you.

I actually had the "Theme: information" part of the view open in another tab when I read that. I never noticed the little question mark image before.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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