1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'XenForo Questions and Support' started by DerTobi75, May 5, 2011.

  1. DerTobi75

    DerTobi75 Active Member

    Is there a way to change the style in "What's new" when the posting is from a specific forum?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> thread_list_item

    Near the top, replace this 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:

    <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
    DerTobi75 likes this.
  3. Digital Doctor

    Digital Doctor Well-Known Member

    Interesting ... if someone tries this ... please post a screenshot !
  4. DerTobi75

    DerTobi75 Active Member

    Great, will give it a try, as soon as I am at home ;)
  5. Nasr

    Nasr Well-Known Member

    You do see Jake Bunce had tried it and posted a screenshot right above your post?
  6. DerTobi75

    DerTobi75 Active Member

    Just tried it, and it works great! Thanks a lot!
  7. lauren

    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?'
  8. Bob

    Bob Well-Known Member

  9. dieketzer

    dieketzer Well-Known Member

    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.
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
  11. Digital Doctor

    Digital Doctor Well-Known Member

    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 ?
  12. Brogan

    Brogan XenForo Moderator Staff Member

    You can always try it on your own forum or test installation if you want to explore how different styling appears.
  13. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yep. You can use other styling if you want.

Share This Page