Hi,
I also added some custom content to the sidebar and would like it to collapse just like the standard content.
So far I added
Code:
<vb:if condition="$close_sidebar"><p class="sidebar_hidden">Test collapsed<vb:else /><p class="custom_sidebar_stuff">Test not collapsed</p></vb:if>
to the FORUMHOME Template. This works but only if you reload the page.
To make the custom content collapse as soon as you click on the collapse button requires some modifications to:
forum/clientscript/vbulletin-sidebar.js
this file contains a toggle function:
Code:
vBSidebar.prototype.toggle_collapse=function(A){YAHOO.util.Event.stopEvent(A);if(YAHOO.util.Dom.getStyle(this.sidebar,"display")=="none")
which sets the element with the ID sidebar to hidden. As CSS ID can only be used once you would have to add the IDs of your custom elements here. But my JavaScript skills are too limited to do so.
Would be great if someone could give me a hint on how to add additional IDs to the toggle_collapse function.
Thank you - all the best,
Sacha