XF 2.2 Combine threads and messages on index

Ignite

Member
How can i combine messages and threads into like how IPS has there display on their forum index.

Instead of:
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

Like this:
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

Is there a way to add the two together using a conditional?
 
Solution
You would need to modify this section of code in the node_list_forum template:

HTML:
<xf:if is="!{$extras.privateInfo}">
    <div class="node-statsMeta">
        <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>
    </div>
</xf:if>

In addition to layout changes you will need to combine the counts using {{ ($extras.discussion_count + $extras.message_count)|number_short(1) }} .
You would need to modify this section of code in the node_list_forum template:

HTML:
<xf:if is="!{$extras.privateInfo}">
    <div class="node-statsMeta">
        <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>
    </div>
</xf:if>

In addition to layout changes you will need to combine the counts using {{ ($extras.discussion_count + $extras.message_count)|number_short(1) }} .
 
Solution
Back
Top Bottom