• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

How To Add A Sidebar To Any Forum Page

jacko

Well-known member
This is the relevant code from the forum_list template:

HTML:
<xen:sidebar>

    <xen:edithint template="sidebar.css" />

    <xen:include template="sidebar_online_users" />

    <div class="section">
        <div class="secondaryContent statsList" id="boardStats">
            <h3>{xen:phrase forum_statistics}</h3>
            <div class="pairsJustified">
                <dl class="discussionCount"><dt>{xen:phrase discussions}:</dt>
                    <dd>{xen:number $boardTotals.discussions}</dd></dl>
                <dl class="messageCount"><dt>{xen:phrase messages}:</dt>
                    <dd>{xen:number $boardTotals.messages}</dd></dl>
                <dl class="memberCount"><dt>{xen:phrase members}:</dt>
                    <dd>{xen:number $boardTotals.users}</dd></dl>
                <dl><dt>{xen:phrase latest_member}:</dt>
                    <dd><a href="{xen:link members, $boardTotals.latestUser}" class="username">{$boardTotals.latestUser.username}</a></dd></dl>
            </div>
        </div>
    </div>

</xen:sidebar>

I did the above. The boxes with online users and stats are empty (showing 0 values). Any idea why?
 

Brogan

XenForo moderator
Staff member
The various statistics on the forum home page don't work in other views/pages.

The data is only exposed for that page.
 

Forsaken

Well-known member
Does anyone know of a solution to this question ?

<xen:if is="{$forum.node_id} == 2">
<xen:sidebar>
</xen:sidebar>
</xen:if>

Replace 2 with whatever forum id you want the sidebar in. You'll also need to fill out whatever blocks you want there by putting them between the <xen:sidebar> tags.
 

Ryan Kent

Well-known member
<xen:if is="{$forum.node_id} == 57">
<xen:sidebar>
<xen:include template="custom_ventrilo" />
</xen:sidebar>
</xen:if>

The xen:include line is in my forum_list template and it causes my ventrilo block to appear on the side bar.

I added the above code to the bottom of the category_view template with the idea to have the ventrilo block appear there. It didn't work. If I take this same code, adjust the node, then add it to forum_view template, it works fine. Any idea why it wont work in category_view?
 

Brogan

XenForo moderator
Staff member
Do you have categories set as pages in Options -> Node & Forum List?

If not then you won't be loading the category template.
 

Ryan Kent

Well-known member
Yes, the Create Pages for Categories box is checked.

I just added the code at the very end of the template. Should it be contained within one of the tags above?

Code:
<xen:title>{$category.title}</xen:title>

<xen:navigation>
    <xen:breadcrumb source="$nodeBreadCrumbs" />
</xen:navigation>

<xen:container var="$quickNavSelected">node-{$category.node_id}</xen:container>

<xen:if is="{$renderedNodes}">
    <ol class="nodeList section sectionMain">
    <xen:foreach loop="$renderedNodes" value="$node">
        {xen:raw $node}
    </xen:foreach>
    </ol>
</xen:if>

    <xen:if is="{$forum.node_id} == 57">
    <xen:sidebar>
    <xen:include template="custom_ventrilo" />
    </xen:sidebar>
    </xen:if>
 

DaveL

Well-known member
Is there a way of using <xen:sidebar> on xenforo pages but without the defult userblock at the top?

EDIT -

Found out how you can do it, use:

<div class="sidebar">
<div class="section">
<div class="secondaryContent">
Content
</div></div></div>

However is there a way to prevent there being a gap as it seems to leave space where the userdetails box normally is.
 
Top