tmc

Customer
Hi,
I'm finally making the move from XF 1.5 to XF 2.1 and was wondering is there any way to enable the sidebar collapse feature, but force sidebar to be active on specific pages?
On xf 1.5 I modified xb_js_body template and added
<xen:if is="!in_array({$contentTemplate}, array('EWRporta2_ArticleList', 'wf_widget_page'))">.......</xen;if> to the sidebar code to achieve it. Anyway to do similar type of thing on 2.1.x with some edits?
We've got a custom online radio page that has some useful information (schedules etc) on the sidebar, so I was hoping to be somehow able to force sidebar to be shown there, while keeping the feature as enabled elsewhere.
If not possible I will learn to live with it, but had to ask.
 
I think this would be a nice solution, pure CSS:

Code:
[data-template="forum_view"]
{
    .p-body-main--withSidebar:not(.xb-sidebar-default) .p-body-content
    {
        padding-right: @xf-sidebarSpacer;
    }
    .p-body-main--withSidebar:not(.xb-sidebar-default) .p-body-sidebar
    {
        display: table-cell;
    }
    #collapseSidebar
    {
        display: none;
    }
    @media (max-width: @xf-responsiveWide)
    {
        .p-body-main--withSidebar:not(.xb-sidebar-default) .p-body-content { padding-right: 0; }
    }
}

Each page has the [data-template="forum_view"] part in the HTML tag that you can find by inspecting the page source. You can add multiple:

Code:
[data-template="forum_view"], [data-template="thread_view"]

And I believe it should all just work the way you want too (y).
 
  • Like
Reactions: tmc

Pre-Sale Questions

If you have any questions or concerns you want to ask before you make a purchase don't hesitate to use one of our multiple support channels for your convenience.

Back