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

XF 1.5 Applying a .class on a custom div when a subforum has a new msg

#1
Greetings again :>
Title says it all: i'd like to apply a .class to a custom div when one of its subforums has a new/unread message.

Any idea ?
Thanks.
 

DL6

Well-known member
#2
I use something like this to display a custom icon in the template node_forum_level_n, maybe this works for you
Code:
<div class="{xen:if $forum.hasNew, 'Unread', 'Read'}"></div>
 
#3
Thanks for your reply DL6. I think this won't work since the custom div that needs the .class is outside the category. :/
 
#5
where is the div located?
If you give more details maybe we can give a better support
Here's the code :

<div id="tabscont" class="tabs_container">
<a rel="nodetab_1" class="nodetabs tabs_1">1</a>
<a rel="nodetab_9" class="nodetabs tabs_2">2</a>

</div>

<xen:include template="tabs.js" />

<xen:container var="$head.canonical"><link rel="canonical" href="{xen:link 'canonical:forums'}" /></xen:container>
<xen:if is="{$xenOptions.boardDescription}"><xen:container var="$head.description">
<meta name="description" content="{$xenOptions.boardDescription}" /></xen:container></xen:if>
<xen:container var="$head.openGraph">
<xen:include template="open_graph_meta">
<xen:set var="$url">{xen:link 'canonical:forums'}</xen:set>
<xen:set var="$title">{$xenOptions.boardTitle}</xen:set>
<xen:set var="$description">{$xenOptions.boardDescription}</xen:set>
<xen:set var="$ogType">website</xen:set>
</xen:include></xen:container>

<xen:hook name="forum_list_nodes">
<xen:if is="{$renderedNodes}"><xen:include template="node_list" /></xen:if>
</xen:hook>
The red lines are the custom divs. Example: If there's a new message in any subforum of the first category, it would add class X to
<a rel="nodetab_1" class="nodetabs tabs_1">1</a>.