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

How to Add a New Section In The Sidebar?

#1
Hello,

I've noticed on some Xenforo sites, there are added rectangular sections on the right side - normally under the forum statics box. Some may say "site of the month" or "advertise here" etc. How do you add these sections/boxes?

Thanks in advance.
 
#3
Hi Jake, thanks for the quick response. I'm not really sure how the google custom search will add the two sections I am referring to. I will show some images for what I was referring to just to clarify. If you could let me know in a little more detail how I can accomplish this, it would be appreciated. Thanks.
 

Attachments

Jake Bunce

XenForo moderator
Staff member
#4
The Google search is just the content of the block in that example. More generally:

Admin CP -> Appearance -> Templates -> forum_list

Add the red code:

Code:
<xen:h1>{$xenOptions.boardTitle}</xen:h1>

<xen:container var="$head.canonical"><link rel="canonical" href="{xen:link 'canonical:index'}" /></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:index'}</xen:set>
		<xen:set var="$title">{$xenOptions.boardTitle}</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>
	
<xen:sidebar>
	<xen:edithint template="sidebar.css" />

	<div class="section">
		<div class="secondaryContent">
			YOUR CONTENT HERE
		</div>
	</div>

	<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>
 

borbole

Well-known member
#6
#7
borbole said:
If you want to add unlimited custom sidebar blocks with ease without manual template edits have a look at my mod here:
Thanks Borbole. You always seem to have an answer for my questions :) I tried going on to your forum to see a demo of this add on but could not access the forum. Btw, any update for the "hide media and attachment link" add on?
 

borbole

Well-known member
#8
Thanks Borbole. You always seem to have an answer for my questions :) I tried going on to your forum to see a demo of this add on but could not access the forum. Btw, any update for the "hide media and attachment link" add on?
I had been away for the last couple of days. Now the forum is open again.

I will have a look at it as soon as I finish a couple of paid mods that I am currently working on.