This is a kind of follow up to this question:

I have a view where I added taxonomy tags as custom CSS class for rows of a unformatted list:

<div class="views-row views-row-1 views-row-odd views-row-first tag1-tag2-tag3">

I did that using Replacement Pattern [tags] as row class.

The problem is that I need to filter by tags and so every taxonomy tag should be added as a separate class. I would need spaces instead of - so the output would be something like that:

<div class="views-row views-row-1 views-row-odd views-row-first tag1 tag2 tag3">

Is this possible with Views GUI or do I have to use Views preprocess function?

2 Answers 2


if you're using multivalue class token, this bug report may be of interest for you. There's also a patch as a workaround available.

Currently if a views field token contains multiple space-separated class names, these classes will be combined into one class when the string is run through drupal_html_class(). Attached is a patch to split token classes before they are sanitized for HTML.

  • Updating to the newest Views module fixed the issue as the mentioned bug is committed since Views 7.x-3.16. Thanks! Now I need to fix the same bug for a References View: drupal.stackexchange.com/questions/245716/…
    – geraldo
    Commented Sep 12, 2017 at 17:25

Under "Format" in the left column of the view, you click on "Settings" near the format you choosed, for example "Unformatted list".

In the popup you can edit the row classes.

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.