How to apply CSS styling to threads from specific forums in What's New?

Jake Bunce

XenForo moderator
Staff member
Admin CP -> Appearance -> Templates -> thread_list_item

Near the top, replace this code:

Code:
<li id="thread-{$thread.thread_id}" class="discussionListItem {$thread.discussion_state} {xen:if {$thread.sticky}, 'sticky'} {xen:if {$thread.isNew}, 'unread'}" data-author="{$thread.username}">
with this:

Code:
<li <xen:if is="{$showForumLink} AND {$thread.node_id} == 4">style="border: 1px red solid;" </xen:if>id="thread-{$thread.thread_id}" class="discussionListItem {$thread.discussion_state} {xen:if {$thread.sticky}, 'sticky'} {xen:if {$thread.isNew}, 'unread'}" data-author="{$thread.username}">
Change the number 4 to specify the forum's node_id.

I am using inline styling here. You can move it to CSS if you want.

The result:

Screen shot 2011-05-05 at 8.57.34 AM.png
 

lauren

Member
using the above info it occurs to me that i can 'remove' threads originating from a given node from appearing in 'whats new'!
my question is 'whats good css to make the entry invisible?'
 

Bob

Well-known member
using the above info it occurs to me that i can 'remove' threads originating from a given node from appearing in 'whats new'!
my question is 'whats good css to make the entry invisible?'
display:none;
 

dieketzer

Well-known member
display:none
one could also ammend jakes code to use an array and target multiple nodes. i did something similar to assign a 'node rating' graphic to the editor templates.
 

Jake Bunce

XenForo moderator
Staff member
using the above info it occurs to me that i can 'remove' threads originating from a given node from appearing in 'whats new'!
my question is 'whats good css to make the entry invisible?'
Yes you could. But I have tried stuff like this before and it messes up the pagination. For example, if there are 20 threads per page and 15 of those threads are in the excluded forum then that page will only show 5 threads.
 

Digital Doctor

Well-known member
You do see Jake Bunce had tried it and posted a screenshot right above your post?
I think I saw it ... but didnt notice anything !

I guess the difference is the red box ?
Did anyone try a different CSS change with a bit more oomph ?
 
Top