Hello, due to my bad level in english and coding i ca't understand what you mean.If you have a flat level tree where each forum’s total posts is the sum of all the direct posts inside it + all the post inside any of the sub forum under that forum, then you could just loop through all the nodes who have the same parent ID and count them in a map. In that case, you might be able to do it with a template modification.
I don't understand your reply, what do you mean ?Forum Statistics is part of the Widgets.
This worked when you put inside the category codeMaybe this{$extras.message_count|number_short(1)}
but how to link it to a category if i want to use it anywhere on the forum ?
node_list_category
<a href="{{ link('categories', $node) }}">{$node.title}</a>
<a href="{{ link('categories', $node) }}">{$node.title}</a> <dl class="pairs pairs--inline">
<dt>{{ phrase('threads') }}</dt>
<dd>{$extras.discussion_count|number_short(1)}</dd>
</dl>
<dl class="pairs pairs--inline">
<dt>{{ phrase('messages') }}</dt>
<dd>{$extras.message_count|number_short(1)}</dd>
</dl>
Edit the templatenode_list_category
Change Line 6<a href="{{ link('categories', $node) }}">{$node.title}</a>
To
HTML:<a href="{{ link('categories', $node) }}">{$node.title}</a> <dl class="pairs pairs--inline"> <dt>{{ phrase('threads') }}</dt> <dd>{$extras.discussion_count|number_short(1)}</dd> </dl> <dl class="pairs pairs--inline"> <dt>{{ phrase('messages') }}</dt> <dd>{$extras.message_count|number_short(1)}</dd> </dl>
Put the css in templateAnd is there away to float this right? Where would I put the CSS float code?
extra.less
:/* float categories threats and post stats right */
.pairs.pairs--inline{
float: right;
}
Example to change the color (text green, numbers purple):how to style the "threads" and "Posts" text?
/* float categories threats and post stats right */
.pairs.pairs--inline{
float: right;
color: purple;
}
.block-header{
dt{color: green;}
}
/* float categories threats and post stats right */
.pairs.pairs--inline{
float: right;
color: purple;
}
.block-header{
color: red;
dt{color: green;}
}
Maybe it will look better with the padding option:Hello Thank you. Yes I got that to work. I was referring to the float right. It squishes the text and numbers a bit. It looks like you're does the same.
/* float categories threats and post stats right */
.pairs.pairs--inline{
float: right;
color: purple;
}
.block-header{
color: red;
dt{color: green;}
dl{padding: 5px;}
}
Maybe this{$extras.message_count|number_short(1)}
but how to link it to a category if i want to use it anywhere on the forum ?
We use essential cookies to make this site work, and optional cookies to enhance your experience.