My view has 3 displays. I need theme output for nodes that shows in block display, but not touch nodes in page display.
If i use node-view-viewname.tpl.php (as suggested in views-view-row-node.tpl.php) then all displays affected. I try node-view-viewname--block.tpl.php, but this doesn't work :(

Sorry for my english.

Comments

merlinofchaos’s picture

Status: Active » Fixed

For the node-* template, it's just one dash: So node-view-viewname-displayid.tpl.php

smacphail’s picture

Sorry to highjack the thread, but it seemed the most relevant that I post this here: is there a naming convention if you want to get specific about a custom content type use with that view?

Ex. my custom content type is "scary_monster", so "node-scary_monster.tpl.php" styles the node view of that content type. For my view, I tried using "node-scary_monster-view-my_view.tpl.php" and variations on that, but didn't seem to get anywhere. Is "node-view-my_view.tpl.php" (or node-view-my_view-displayid.tpl.php) the last part in the chain, and if I want to style content types differently I'll need to do the logic within that tpl file (if...else statement by looking at $node->type)? Or am I missing something?

Thanks!

Status: Fixed » Closed (fixed)

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

merlinofchaos’s picture

Sorry, node type and view name cannot be combined to get combination templates. If you want that you'll have to add it as a template suggestion in your THEME_preprocess_node function in template.php.

ludo.r’s picture

Version: 6.x-2.3 » 6.x-2.9
Status: Closed (fixed) » Active

I suppose it would work in THEME_preprocess_views_view_row_node() too?

How can i tell the node to use my node-my_type-My_view-page_1.tpl.php?
I'm sure this can be done with theme() function, but i dont know how!?

Thank you!

esmerel’s picture

Status: Active » Closed (fixed)

This issues has been closed (and was against a very different version) 6 months ago. Please don't reopen issues like that.

ludo.r’s picture

Ok, i wil not reopen issues like that.
Thanks for help.