I know that I can do a template override to style the views output, as described here.

I've also used a template preprocess function to add a "row_classes" to a views output. This will add DIV classes, but is it possible to add IDs as well?

Could I also use the views UI for that, maybe with a rewrite?

  • 1
    I haven't seen one, so I have been placing views in panels to expose an ID.
    – Ashlar
    Commented Jan 31, 2012 at 23:25

1 Answer 1


Btw, I ended up using a rewrite in the views UI. I added "content:nid" to the top of the fields and then used "rewrite content" on the title field to:

<div id="nid[nid]">[title]</div>

Not a perfect solution but it seemed practical to me (at least at the time of writing this) ;-)

Your Answer

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

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