Highlighting certain topics in topic list view


(Tom Wrench) #1

I’m wanting to highlight topics with a certain tag with a different background colour in the topic list view. In my case, I’ve tagged “advertisement” type topics with ‘advertisement’ and I would like them to be highlighted a light yellow on the topic list view to stand out, as per my mockup below. Would there be a CSS hack (or otherwise) to achieve this?

Thanks


(Jeff Atwood) #2

I am not sure this is possible with tags but there are category CSS classes per row.


(Hammad Abbasi) #3

Tags have title attribute so you can use css selector (badge-category[title=“tag-title.”] ) to apply any style on them but if you want to highlight the entire row then you have to select parent which i don’t think is possible via css.

I would use javascript to achieve this

var allrows =document.querySelectorAll(“a[title=“new topic”]”);
for( i in allrows) {allrows[i].parentNode.parentNode.style.backgroundColor="#FFFFE0";}

I was able to highlight topics tagged with “new”