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

Arrange sidebar modules

Jake Bunce

XenForo moderator
Staff member
#3
Here is a guide to add a sidebar to any page:

http://xenforo.com/community/threads/how-to-add-a-sidebar-to-any-forum-page.7860/

The index page already has a sidebar. See this template:

Admin CP -> Appearance -> Templates -> forum_list

You will see the different sidebar modules in order in the template:

Code:
<xen:sidebar>
	<xen:edithint template="sidebar.css" />
	
	<xen:hook name="forum_list_sidebar">
		<xen:include template="sidebar_online_users" />
		
		<!-- block: forum_stats -->
		<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_count}:</dt>
						<dd>{xen:number $boardTotals.users}</dd></dl>
					<dl><dt>{xen:phrase latest_member}:</dt>
						<dd><xen:username user="$boardTotals.latestUser" /></dd></dl>
					<!-- slot: forum_stats_extra -->
				</div>
			</div>
		</div>
		<!-- end block: forum_stats -->
		
		<xen:include template="sidebar_share_page">
			<xen:set var="$url">{xen:link canonical:index}</xen:set>
		</xen:include>
		
	</xen:hook>
</xen:sidebar>
For example, you can move the list of online users by moving this code within the above code:

Code:
<xen:include template="sidebar_online_users" />