0

Hello i am trying to override a node view without much success. I dont know if its just the syntax for my view thats wrong.

When i go to theme information the Row Style output tpl suggestion is

views-view-row-node--taxonomy-term--page-3.tpl.php

i can override that fine but it suggests it would be better to overide node-view-VIEWNAME.tpl.php

So i have a tpl file named

node-view-taxonomy-term-page-3.tpl.php

but it doesnt seem to want to override. Am i missing maybe a '-' somewhere in the tpl title?

I am using Views 3 and D6. I have the tpl in the same folder as my node.tpl.php

all help appreciated thanks.

  • Obligatory CTFC comment: Have you tried clearing the cache? – aendrew Nov 20 '12 at 14:20
  • sorry aendrew yes i have cleared the cache a few times but to no avail. thanks – Reg Gordon Nov 20 '12 at 14:20
  • Some more info would be helpful -- what are you wanting to do? views-view-row-* does something much differently than node-view-taxonomy-term-*: the former themes a View row, the latter themes a taxonomy term page. – aendrew Nov 20 '12 at 14:25
  • thanks for the reply aendrew. I want to theme the node output on one of my taxonomy views. You can view the view here onlinebanter.com/blogs I am trying to theme the Page: Theming information (row style) as with my theme the node view is a bit odd as you can see. Its geared towards the frontpage. I was hoping to make the 'node' full width in this view and not as it is. Im sorry if i sound a little confused as i am :( – Reg Gordon Nov 20 '12 at 14:30
  • What suggests it would be better to override Reg? – Alex Gill Nov 20 '12 at 14:34
2

The best way to do this is to see what your available theme suggestions are for that node.

In your theme add the following snippet and clear cache, refresh page, etc.

function YOURTHEME_preprocess_node(&$vars) {
   var_dump($vars['template_files']);
   //dsm($vars['template_files']); // if devel module installed
}
| improve this answer | |
  • thanks for your time alex. I have added the code to my template.php but i am getting a white screen now across my website. I renamed it to function journalcrunch_preprocess etc (name taken from my info file) also tried function phptemplate_ as per some of the other code in my template but still the white screen of death. I have Devel installed if that helps at all? – Reg Gordon Nov 20 '12 at 14:52
  • Updated answer, its because your on v6. – Alex Gill Nov 20 '12 at 14:59
  • lol k tx brb Alex :leaving – Reg Gordon Nov 20 '12 at 15:00
  • 1
    @RegGordon -- FWIW, try the module Devel Themer if you're doing a lot of theming. It's super useful for figuring template suggestions. – aendrew Nov 20 '12 at 15:06
  • 1
    a bingo i think im there. i just copied my node tpl in there and changed a few classes. sorted. tx again folks. – Reg Gordon Nov 20 '12 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.