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

Different styling on what's new for specific forum

#1
We got a forum where around 50% of the posts are in a fitness journal forum. What would be the best way to style those threads differently on what's new (and possibly in the journal forum listing), like adding a css class? I'm guessing thread prefixes could be used when that comes around.

Thread
Thread
Journal
Thread
 

Trombones13

Well-known member
#2
I would say that thread prefixes would be your best bet, once 1.1 is out. For now, perhaps preface each thread with the word in brackets, such as "[Journal] This is the rest of my thread title." That might be the best route to take for now.
 

Digital Doctor

Well-known member
#3
Interesting idea. vaultwiki does this with vB and it works very well.
It becomes an even more intuitive idea when it applies to other types of items such as:
  • wiki items
  • images
  • article items
  • downloads
  • blog entries
 

Jake Bunce

XenForo moderator
Staff member
#6
Edit this template:

Admin CP -> Appearance -> Templates -> thread_list_item

Add the red code near the top. {$showForumLink} limits the styling to the what's new page:

Code:
<xen:require css="discussion_list.css" />

<xen:if is="{$thread.isDeleted}"><xen:include template="thread_list_item_deleted" /><xen:else />

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

	<div class="listBlock posterAvatar">
		<span class="avatarContainer">
			<xen:avatar user="$thread" size="s" img="true" />
			<xen:if is="{$thread.user_post_count}"><xen:avatar user="$visitor" size="s" img="true" class="miniMe" title="{xen:phrase you_have_posted_x_messages_in_this_thread, 'count={xen:number $thread.user_post_count}'}" /></xen:if>
		</span>
	</div>
Then edit this template:

Admin CP -> Appearance -> Templates -> EXTRA.css

Add this code to define the styles for each forum. Specify the node_id in the class names:

Code:
/* SET CUSTOM STYLE FOR DIFFERENT FORUMS IN WHAT'S NEW */
/* SPECIFY NODE_ID IN CLASS NAME */

.threadListNode2 .title a
{
	color: red;
}
.threadListNode5 .title a
{
	color: green;
}
The result:

Screen shot 2011-09-13 at 4.30.47 PM.png
 

bambua

Well-known member
#10
So awesome that something like this is possible as a built in solution in the style templates, no mods required. Hats off!
 

Blue

Well-known member
#12
I must have missed something, it's not working for me :(
Using with double-digit node ids.

.threadListNode49 .title a