MyBB Community Forums

Full Version: Styling Thread List Rows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to highlight the rows for threads on the forum display and search results page. Two methods I've currently tried don't really work.

First I added a variable after {$bgcolor} to add my own class; needs edits to the templates for the rating and inline mod column too. This works fine on the forum display but not on the search results; with the search results, the hook is after the inline mod template has been eval'd, so I can't set the colour of it; if I set the value of the variable, it colours the inline mod box of the next row, not the row I want to colour. The only way I can get around that is to give that table cell an ID and set the colour via javascript, but I really don't want to have to do that.

Second thing I tried is to colour the table row, as that's just one edit to one template, and will always do the whole row. Problem with that is the colours for inline mod and unapproved highlighting don't show. This is the CSS I've tried:

These don't highlight the row in my colour but inline mod/unapproved works:

.my_class_name {
	background: #000000;
}
.my_class_name {
	background: #000000 !important;
}

Obviously wouldn't as the cells would have a trow class on them which is added after. This highlights the row in my colour but inline mod/unapproved doesn't work:

.my_class_name td {
	background: #000000;
}

I know I could get around it by adding !important to the class for inline mod and unapproved highlighting, but I really don't want to edit default CSS to get it to work.

Anyone got any ideas how I can get it to work?? It should be pretty simple and I'm probably missing something stupid but both methods I can think of mostly work but have unwanted side effects meaning I can't use either of them. I really don't want to use javascript to set the colour but looks like I may have to if I can't find another way.

Thanks.