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
Comment #1
merlinofchaos commentedFor the node-* template, it's just one dash: So node-view-viewname-displayid.tpl.php
Comment #2
smacphail commentedSorry 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!
Comment #4
merlinofchaos commentedSorry, 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.
Comment #5
ludo.rI 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!
Comment #6
esmerel commentedThis issues has been closed (and was against a very different version) 6 months ago. Please don't reopen issues like that.
Comment #7
ludo.rOk, i wil not reopen issues like that.
Thanks for help.