Hooligan

Registered
Not sure if I'm in the right spot for this (if not, I apologize, and please move the thread accordingly)

But, I had asked about the collapsible sidebar and was referred here.

Is there a way to make the collapsible sidebar option so that it collapses in forum view, but permanent in forum list? Some of my members dislike the sidebar in forum view but still want to be able to view it in the forum list/main page without having to click the collapse button every time.
 
Hi @Hooligan

I'm not seeing a license associated with your account? Can you clarify as that option is only in our premium styles and none of our free ones, so I assumed you owned a license.
 
We do. There is more than one administrator for our board. I'd just have to get a hold of the other and ask her what her account here, is.

That would be great, hope you can understand we limit our support to licensed users. The owner of the style can come on and associate your name with the license so you can ask or support as well.

They need to go onto their license page and click "License Users" and proceed to add yours.
 
Hey sorry for the delay,

So: Is there a way to make the collapsible sidebar option so that it collapses in forum view, but permanent in forum list? Some of my members dislike the sidebar in forum view but still want to be able to view it in the forum list/main page without having to click the collapse button every time.

You basically want it so the collapsing option will only work on the forum_list itself, and make it so forum_view can't be collapsed? Is that correct?

Or are you wanting them as basically two separate settings when it comes to saving preferences?
 
.
You basically want it so the collapsing option will only work on the forum_list itself, and make it so forum_view can't be collapsed? Is that correct?

Or are you wanting them as basically two separate settings when it comes to saving preferences?
Basically, we want it so that the collapse option doesn't collapse the sidebar on both forum_list and forum_view, only forum_view.
 
So open xb_js_body

Look at the bottom for:

Code:
<xen:if is="{$sidebar} AND @xb_enable_collapsesidebar">

Replace with:

Code:
<xen:if is="{$sidebar} AND {$contentTemplate} == 'forum_list'">

See if that works for you
 
Basically, we want it so that the collapse option doesn't collapse the sidebar on both forum_list and forum_view, only forum_view.

Sorry I think I misunderstood.

Do you want the button showing on forum_view and forum_list? But each controls separately so if you collapse it on forum_view, it wouldn't effect forum_list and vice versa?
 
There is probably a better way of approaching this, but in that same template, add this:

Code:
<xen:if is="{$sidebar} AND {$contentTemplate} == 'forum_view'">
<script>
$('.sidebar').ready(function() {
  var collapse = function(){
  $.setCookie('sidebarCollapsedFV', '1');
  $('.sidebar').fadeTo('slow', 0).delay('fast').animate({width:'toggle'},'slow');
  $('.mainContent').delay('fast').animate({{xen:if "@xb_leftSidebar", 'marginLeft', 'marginRight'}:'0'},'slow');
  $('.sidebarCollapse').removeClass('@xb_collapseSidebar').addClass('@xb_expandSidebar');   
  };
  var uncollapse = function(){
  $.setCookie('sidebarCollapsedFV', '0');
  $('.sidebar').animate({width:'toggle'},'slow').delay('fast').fadeTo('slow', 1);
  $('.mainContent').animate({{xen:if "@xb_leftSidebar", 'marginLeft', 'marginRight'}:{xen:calc '@sidebar.width + 10'}},'slow');
  $('.sidebarCollapse').removeClass('@xb_expandSidebar').addClass('@xb_collapseSidebar');
  };
  if ($.getCookie('sidebarCollapsedFV') == '1') {
  $('.sidebar').hide().css('opacity', 0);
  $('.mainContent').addClass('sidebarCollapsedextend');
  $('.sidebarCollapse').removeClass('@xb_collapseSidebar').addClass('@xb_expandSidebar');
   $('.sidebarCollapse').toggle(uncollapse, collapse);
  } else {
   $('.sidebarCollapse').toggle(collapse, uncollapse);
   $('.sidebarCollapse').addClass('@xb_collapseSidebar');
  }   
});

   </script>
</xen:if>
Right below that other bit of code:

Code:
   $('.sidebarCollapse').addClass('@xb_collapseSidebar');
  }   
});

   </script>
</xen:if>

It'll basically function as two different cookies, so the collapse state will be controlled separately
 
There is probably a better way of approaching this, but in that same template, add this:

Code:
<xen:if is="{$sidebar} AND {$contentTemplate} == 'forum_view'">
<script>
$('.sidebar').ready(function() {
  var collapse = function(){
  $.setCookie('sidebarCollapsedFV', '1');
  $('.sidebar').fadeTo('slow', 0).delay('fast').animate({width:'toggle'},'slow');
  $('.mainContent').delay('fast').animate({{xen:if "@xb_leftSidebar", 'marginLeft', 'marginRight'}:'0'},'slow');
  $('.sidebarCollapse').removeClass('@xb_collapseSidebar').addClass('@xb_expandSidebar');  
  };
  var uncollapse = function(){
  $.setCookie('sidebarCollapsedFV', '0');
  $('.sidebar').animate({width:'toggle'},'slow').delay('fast').fadeTo('slow', 1);
  $('.mainContent').animate({{xen:if "@xb_leftSidebar", 'marginLeft', 'marginRight'}:{xen:calc '@sidebar.width + 10'}},'slow');
  $('.sidebarCollapse').removeClass('@xb_expandSidebar').addClass('@xb_collapseSidebar');
  };
  if ($.getCookie('sidebarCollapsedFV') == '1') {
  $('.sidebar').hide().css('opacity', 0);
  $('.mainContent').addClass('sidebarCollapsedextend');
  $('.sidebarCollapse').removeClass('@xb_collapseSidebar').addClass('@xb_expandSidebar');
   $('.sidebarCollapse').toggle(uncollapse, collapse);
  } else {
   $('.sidebarCollapse').toggle(collapse, uncollapse);
   $('.sidebarCollapse').addClass('@xb_collapseSidebar');
  }  
});

   </script>
</xen:if>
Right below that other bit of code:

Code:
   $('.sidebarCollapse').addClass('@xb_collapseSidebar');
  }  
});

   </script>
</xen:if>

It'll basically function as two different cookies, so the collapse state will be controlled separately
So add both codes to xb_js_body?
 
Yes, add this snippet under the other JS code. But... make sure you apply the conditional as I did above. You'll basically have 2 different codes, one loads on forum_list, one loads on forum_view
 

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