Jake Bunce
Well-known member
This guide is for adding a sidebar to any forum page. It will be like the one that is already on the index page:
The first question is, on what page do you want to display the sidebar? Then you need to find the root template for that page. See this guide for help finding the root template of a page.
For example, thread_view is the root template for all thread pages. If we want to add a sidebar to that page then edit this template:
Admin CP -> Appearance -> Templates -> thread_view
Then add this code to the bottom of the template:
That will create an empty sidebar that contains only the user block (which is part of the default sidebar). Then you can add your own content to the sidebar by inserting your code between those sidebar tags.
To add formatted content blocks to the sidebar like those seen on the index page (see above picture) you can add code like this:
You can add multiple instances of that code if you want to create multiple content blocks:
If you want to add the same sidebar content to multiple pages then you can put that content into a new template:
Admin CP -> Appearance -> Templates -> Create New Template
Give the template a name (e.g. my_sidebar_content). Then to call on that template you would use code like this when editing the root template:
There are different ways to organize the sidebar code using templates, but this gives you the general idea. The only other thing I would note is that the user block that is contained in the sidebar by default is contained within this template:
Admin CP -> Appearance -> Templates -> sidebar_visitor_panel
So, for example, if you don't want that user block to appear in your custom sidebar, but you still want it to appear on the index page, then you can cut that code from sidebar_visitor_panel and paste it into forum_list between its sidebar tags.
The first question is, on what page do you want to display the sidebar? Then you need to find the root template for that page. See this guide for help finding the root template of a page.
For example, thread_view is the root template for all thread pages. If we want to add a sidebar to that page then edit this template:
Admin CP -> Appearance -> Templates -> thread_view
Then add this code to the bottom of the template:
Code:
<xen:sidebar>
</xen:sidebar>
That will create an empty sidebar that contains only the user block (which is part of the default sidebar). Then you can add your own content to the sidebar by inserting your code between those sidebar tags.
To add formatted content blocks to the sidebar like those seen on the index page (see above picture) you can add code like this:
Code:
<xen:sidebar>
<div class="section">
<div class="secondaryContent">
YOUR CONTENT HERE
</div>
</div>
</xen:sidebar>
You can add multiple instances of that code if you want to create multiple content blocks:
Code:
<xen:sidebar>
<div class="section">
<div class="secondaryContent">
YOUR CONTENT HERE
</div>
</div>
<div class="section">
<div class="secondaryContent">
EVEN MORE CONTENT HERE
</div>
</div>
</xen:sidebar>
If you want to add the same sidebar content to multiple pages then you can put that content into a new template:
Admin CP -> Appearance -> Templates -> Create New Template
Give the template a name (e.g. my_sidebar_content). Then to call on that template you would use code like this when editing the root template:
Code:
<xen:sidebar>
<xen:include template="my_sidebar_content" />
</xen:sidebar>
There are different ways to organize the sidebar code using templates, but this gives you the general idea. The only other thing I would note is that the user block that is contained in the sidebar by default is contained within this template:
Admin CP -> Appearance -> Templates -> sidebar_visitor_panel
So, for example, if you don't want that user block to appear in your custom sidebar, but you still want it to appear on the index page, then you can cut that code from sidebar_visitor_panel and paste it into forum_list between its sidebar tags.