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

Add custom sidebar block

Trombones13

Well-known member
I figured this would be complicated, but it's actually a pretty easy edit to make. :D I didn't already see a guide for this, so:

1. Make a custom template (any title is fine):
Code:
<div class="section">
	<div class="secondaryContent">
<h3>TITLE</h3>
TEXT INSIDE
	</div>
</div>

2. Open template PAGE_CONTAINER and find {xen:raw $sidebar}. Just below that (before the closing div tag), add:
Code:
<xen:include template="name_of_your_custom_template" />

That should be it! The block will appear at the bottom of the sidebar. If you want it to appear just below the visitor_panel block, but above the Staff/Members Online Now blocks, move the xen:include tag one line up, above {xen:raw $sidebar}. :)

trombones_sideblock-png.7395


To choose an alternate location to place your sidebar block(s), please see this post. :)
 
Hi Trombones,

Newbie question. When the template is made how is it saved? Php, txt? And where is it stored so I can may call it up with the other code? thanks.
 
Hi Trombones,

Newbie question. When the template is made how is it saved? Php, txt? And where is it stored so I can may call it up with the other code? thanks.
Good question. You don't save is "as" anything. Just give it a title, with _ in between the words if there's more than one word in the title, and click the save button. It does it all for you. :)
 
Kurt, what if I want to place the block in another position in the sidebar? Like right below the Members Online box.

How would I do that?
 
Good question. You don't save is "as" anything. Just give it a title, with _ in between the words if there's more than one word in the title, and click the save button. It does it all for you. :)

Ahh inside the ACP. Got it, thanks Peggy.
 
Kurt, what if I want to place the block in another position in the sidebar? Like right below the Members Online box.

How would I do that?
XF Sidebar Locations.webp
For all of these edits, the text you're putting in will be <xen:include template="kurt_social" />. Just replace kurt_social with the name of your template.

1. Below the Visitor Panel (your name, messages, likes, and points):
Template: forum_list
Add above: <xen:include template="sidebar_online_users" />

2. Below "Staff Online Now:"
Template: sidebar_online_users
Add above: <!-- block: sidebar_online_users -->

3. Below "Members Online Now:"
Template: forum_list
Add above: <!-- block: forum_stats -->

4. Below "Forum Statistics:"
Template: forum_list
Add below: <!-- end block: forum_stats -->

5. Below all other sidebar blocks (in this instance, TaigaChat):
Template: PAGE_CONTAINER
Add below: <!-- end block: forum_stats --> and any other <xen:include template lines
 
Top Bottom