I'm trying to create a page by using view 2. This page list all the nodes and grouping by their taxonomy term. In this view the Style as Unformatted and Row style as Fields. The fields as following:
Node: Title
Node: Teaser
Taxonomy: Term
The problem is that I want the first row under each term display both Title & Teaser and the rest display only the Title. Example:
-News
- Title & Teaser
- Title
- Title
-Sport
- Title & Teaser
- Title
- Title
-Entertainment
- Title & Teaser
- Title
- Title
I tried to theme by using
- views-view-unformatted.tpl.php
- views-view-fields.tpl.php
- views-view-field.tpl.php
above three files with no luck. I have struggled with this issue for a while now, any help will be appreciated. Thank you.
Best Answer
You'll need to use the 'Row style output' template (e.g. views-view-fields.tpl.php).
To make it unique to your view, you'll want to use a more specific template name than that, such as the last possible template name showed in that section - e.g.
views-view-fields--myview--default.tpl.php
.Once there, you'll need you have a global variable to keep track of the current row, something like: