Hi,

I have customized my content type template file (node--events.tpl.php), and it works fine.

Problem is with the taxonomy term pages (nodes).
Events have fields with taxonomy term reference, i.e. countries.

If I leave the default node.tpl.php and go to e.g. USA it displays the title, and a trimmed body of all the events, which is fine, but of course if I use the custom node--events.tpl.php file it loads that one, which has some styling, and text that the default node.tpl.php does not have; it does not display other fields but the title, and trimmed body, but all the body, and other stylings are loaded.

To customize the node--events.tpl.php I am using this
<?php echo render($content['field_whatever_field_name']); ?>
for all the fields in events content type.

How can I strip the customization from node--events.tpl.php so that I get the default behaviour of taxonomy page (node)?
I tried using context, but whatever I tried does not work, of course I could have missed the right combination.

Anyhow, your suggestions are welcome.

Partly OT, I tried finding out how to customize the taxonomy page, but couldn't find anything like the node, or other tamplate customization guide, or if I did I either didn't realize it, or simply couldn't understand; so if you have some suggestion is also welcome.

Thank you

Comments

nevets’s picture

I would suggest instead of using a custom node.tpl.php you use display suite. Depending on exactly what you are trying to do, this can get you where you want without custom coding and makes it easier to handle different view modes (in this case 'full' vs 'teaser') without the need for conditional code.

keneso’s picture

Thank you.
Following your suggestion I tried display suite, but it doesn't quite do what I need, it doesn't have the layout I need/want.
Actually it does let me create my custom layout, but at that point I still have to do custom coding, with some extra php stuff.
I will try that road, but would like to have the alternative of theme customization.

So I am back to the original question.
I found taxonomy-term.tpl.php, and eventually more detailed if needed, problem is I can't seem to get it working, it keeps outputting the custom template.

keneso’s picture

Thank you nevets,

so it turns out it wasn't so hard to customize display suite, got rid of node--events, and using display suite custom template.