XF 2.2 How do I add a sidebar to a page node

ak38

Active member
Licensed customer
Hi there,

I'm new to the page node side of things but would like to create several pages, the question is how do I add a side bar to a custom page?

Thanks for your help guys!
 
Update--turns out it is <xf:sidenav>.

The formatting is really wonky though. I'm going to have to dig through the CSS to make it usable.

This is a case where we need a specific page with two sidebars...
 

<xf:navbar> doesn't work.

View attachment 335251

But there has to be a way to add a left sidebar to the page?
In a page node both of these work. Replace latest_poll with your widget. I find it weird that we can put widgets on the left in pages but not the forum index.

<xf:widget key="latest_poll" position="sidebar" />
<xf:widget key="latest_poll" position="sidenav" />
 
I'm doing it slightly different, but it also works. It leaves out the position, but groups all the widgets together based on location which is a little easier on my eyes. (I'm only starting out, but am adding more sidenav and sidebar widgets.)

HTML:
<xf:sidenav>
    <xf:widget key="portal_sidebar_featured" />
</xf:sidenav>

<xf:sidebar>
    <xf:widget key="portal_links" />
</xf:sidebar>

<xf:widget key="portal_consulting_full" />

And I agree...in some cases, I'd like to have sidenav on the forum index, as there is certain information we'd like to "bubble up" to the top, above the fold, while also listing our forums in the middle.
 
The one negative side-effect of sidenav is that in responsive view on mobile, it collapses to a navigation menu. So we can't use this anyway. I mean, it does make sense as it is called sidenav, for navigation.

So we still need an option for a left sidebar that isn't a navigation sidebar. There is a template modification to add a left sidebar, but I would have to wrap it in a conditional to appear only for this page node. I may have to resort to that.
 
Back
Top Bottom