Currently I was theming 2 view outputs via "row style = node, unformatted" and using the "node-view-VIEWNAME.tpl.php" to theme them. When I was using Views 6.x-2.1, everything was working fine and both files were being picked up and displayed in their themed format. I currently made the upgrade to 6.x-2.2 and now Drupal cannot even see that my "node-view-VIEWNAME.tpl.php" files even exist in my theme folder, and are revering to just the "node.tpl.php" template file.

I personally like to theme this way as it really provides the most customized approach (using Devel and/or Content Templates).

I went through a lot of the code of the old view module and new module in the patch and cannot find a reason why this is not appearing. I reset the cache on the server, views cache, even the theme cache in the specific view (even though it probably will not do anything) and it made no changes.

Is anyone else having this issue, and/or know of any ways around it?

Thanks,

Jason

Comments

netrics’s picture

I found ways to fix the issue on my site at the moment, but this issue is still in effect. You can keep the issue open if other users have a similar problem. Otherwise then just terminate it.

asimmonds’s picture

Possibly duplicate with #348182: node-view-X.tpl.php theme override no longer works
Do you use the date.module like this other user?

Also. try the Theme developer module from the devel module suite: http://drupal.org/project/devel

You should be able to use this to show you what template file is actually being used and what template files have been considered by the theme system.

ecstasy2’s picture

Status: Active » Closed (duplicate)

I had the same probleme.
it was due to a date_module bug.

mrfelton’s picture

Status: Closed (duplicate) » Active

I have the same problem, only makeing the change in the Date module didn't fix it. Actually I disabled the sate module completely and still no change. theme_developer shows the candidate template file as I expect, but Views doesn't pick it up.

mrfelton’s picture

Status: Active » Closed (duplicate)

I take it back. My issue was that I had not included node.tpl.php in my zen subtheme, so the more specific node-view-my_view.tpl.php was not being picked up.

jrc’s picture

subscribing. I also encountered this problem with XML templates not being recognized when when placed into the the themes/mytheme folder or even the views_bonus/export folder. Custom templates are not recognized and honored.

Here my wrinkle: I have never installed date.module.

jrc’s picture

Interesting sidenote: I installed devel themer to find out what template was getting called, and views started calling the custom template properly. Is there a process/hook/event which gets triggered when installing a module generally--or installing devel themer in specific--which has anything to do with the way custom templates get handled, cached, or otherwise put into some persistent form?

asimmonds’s picture

@jrc - yes, after module installation, the theme cache is rebuilt, updating the stored information about all the theme templates.

joshuaipowell’s picture

Another tip to getting the node templates to work correctly.

If you have not specifically selected to use a Row Style of node in the View (admin/build/views/edit/VIEWNAME), Drupal does not know to look for the template named node-view-VIEWNAME.tpl.php.

aminalid’s picture

If you use Drupal 6 Views and try to override a node-view-VIEWNAME.tpl.php template, you MUST also override the node.tpl.php template in your theme. Otherwise it won't be picked up.

http://kfalck.net/2008/11/28/drupal-node-view-xtplphp-requires-nodetplphp

tmsimont’s picture

Hi, I have a node.tpl.php in my theme folder and drupal still doesn't recognize my node-view-LEAD-AUTO-CONTENT.tpl.php file.

Is there anything i need to do other than just put that file into the theme folder?

I do have the date module installed, has anyone conclusively linked the issue to that module?

thanks
- http://www.trevorsimonton.com/

tmsimont’s picture

nevermind. it works now.

what did it was using underscores rather than dashes:

node-view-lead_auto_content.tpl.php

rather than

node-view-lead-auto-content.tpl.php

choofins’s picture

This is exactly what solved my issue.

The naming scheme from using the view name in the Views template files uses dashes (-) for the underscores in the machine name of the view, but when using the node template files you must give the exact machine name of the view.

Stupid and confusing, but hopefully this page helps more people.

ScottHovestadt’s picture

Not including the global node.tpl.php in my Zen subtheme was also my problem. To fix, simply copy the node.tpl.php into your subtheme's folder.

alex.pilon’s picture

This worked for me; thanks

roMancer’s picture

Looks like one has to change the view's Row Style to 'node' to make node-view-VIEWNAME.tpl.php work.
An attempt to sum it up:

HOW TO MAKE "node-view-VIEWNAME.tpl.php" WORK:

- make sure 'node.tpl.php' is present alongside node-view-VIEWNAME.tpl.php
- switch view's Row Style to 'node'
- 'node'-type-template needs exact machine name of view in VIEWNAME
- explicitly hit 'Clear cached data' (site configuration -> perfomance) after adding/renaming/removing templates, or set 'Rebuild the theme registry on every page load' (site configuration -> Devel settings)

(tested with drupal 6.19)

ouissla’s picture

Hey!

I followed the steps describe above. But it's still not working for me. There is something I don't understand. On the node reference field configuration, it is said "Only views that have fields will work for this purpose.". But when you create a view with row style "node", fields are disabled.

If I create a view with row style "node", my view doesn't appear in the list of views on the node reference field configuration. If I use row style fields, defining some fields, my view appears, and the display of the autocomplete fields is modified. If then I modified the row style back to node, my node-view-VIEWNAME.tpl.php is not used, and I still have the "row style fields" display.

My view is called "pr". In my theme folder I have a node.tpl.php, and a node-view-pr.tpl.php. I cleared the cached several times.

Any other solution ?

mtpultz’s picture

Did you ever get this to work? I'm having the same problem it stills sees node.tpl.php even when I follow post #16 set of instructions. Any ideas?

timd.mackey’s picture

Just to further clarify, if you are using subfolders in your template folder, your node-view-VIEWNAME.tpl.php file MUST be in the same subfolder as your node.tpl.php file.

Also, from what I can tell you can only have one node.tpl.php file, so if you have, for instance, a views subfolder where you put your views template files, and a nodes subfolder where you put your node template files, you have to put your node-view-VIEWNAME.tpl.php file in your nodes folder, not your views folder. You can't put them in two different subfolders.