I'm building a site in Drupal 7. I'm using the view module to query the kind of content I want to display in a list. I have a view that gather the latest content on the site. all pages are articles content type to which a category is assigned. I need to colour code the different category to help with the navigation. I'm trying to add a custom class to every list item when Drupal aggregate the content in my view, based on the page taxonomy.
In the view module, there is a field where, i believe, it's possible to replace / add a custom class to every item wrapper (row class field).
You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.
I tried to add the following token to output the class dynamically [node:field-article-category:vocabulary]
, [node:field_article_category]
, [content:field_article_category]
etc...
But it only output something like: -nodefield-article-category
.
Is it something that's actually doable or did i got it all wroooong?
cheers
update
if in the row field i add the value [title]
I get the value of the article title in the class name. I can't seem to find out how I can reference my taxonomy term. I have created a Categories taxonomy (machine name: categories). I tried to just use [term]
, [categories]
or [node:field_article_category]
which is the value used by the PathAuto module to generate the url. but nothing is working. is there a simple name i'm missing?