3

I'm using the Views module with the unformatted style with full content, and I'm using node.tpl.php to style the row. I'm looking for a way to determine what row it is (e.g. I want to style the first row different than the subsequent rows).

Is there any variable that is available to the template? Is this something I would have to add into the template.php (via a pre-process function, or something of that nature)?

2 Answers 2

1

Views already wraps each row in all sorts of CSS classes, like views-row, views-row-#, views-row-first, views-row-last, etc, so if all you want to do is STYLE things differently, you can use these classes. Now, if you want to re-arrange the CONTENT of your node, that's a whole 'nother story...

0

So using css is by far the easiest way, however if really need to customize it, you can make two views, one for the top row (set the page limit to one) and one for all others (set the offset to 1). You can then use a different style for each. You can also use Views Split Node which essentually does the same thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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