0

I have a view which outputs node titles from various content types, what I need is to theme the view template so one of the css classes for each row in my view is the item's content type. How would I do that?

EDIT: I tried to add the code below in the view template file but it doesn't seem to output any code:

<ul class="<?php print $fields['type']->content ?>">

In fact I even tried outputting it as a regular field but it simply seems to be ignored:

<?php print $fields['type']->content ?>
2

You need to adjust the template (tpl) file that's being used to generate the markup for the Views output. I think everything you'll need as well as a bunch of related and equally important info can be found here: Mustardseed -> Views Theming

  • OK problem solved, I think in addition to my other problems, my view was a little buggy but it seems to be working now. I'll go with your answer, because watching a couple of mustard seed's videos really gave me insight into theming rows -- thanks! – Jane Sep 26 '11 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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