Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-29-2012, 05:34 PM
Jakub03 Jakub03 is offline
 
Join Date: Dec 2011
Posts: 185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Sidebar collapse default

So on the sidebar there is the different widgets
http://mypokerhub.com/forumdisplay.p...o-My-Poker-Hub

Is is possible to make it so that all the widgets are collapsed on default? Where would i go to edit the code to make it do that or how could i make them automatically collapsed?
Reply With Quote
  #2  
Old 01-29-2012, 07:34 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The system is designed to default to expanded, and when a user collapses a block, the name of that block is listed in a cookie. Then when a page loads, a javascript function checks the vb_collapse cookie for a list of blocks that are collapsed and hides them. So you could modify the block_html template to default to collapsed, but since there's no js code that looks to expand collapsed blocks after the page loads, it will always load as collapsed.

You could write your own js to allow for default collapsed blocks, and modify the block_html template (I believe it's the class="collapse" that the built-in vb collpase system looks for). I don't thin k it would be too difficult (unless you don't know any js of course).
Reply With Quote
  #3  
Old 01-29-2012, 08:16 PM
Jakub03 Jakub03 is offline
 
Join Date: Dec 2011
Posts: 185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And this would make the individual widgets in the sidebar be collapsed by default? I don't want the sidebar to be collapsed by default just the individual widgets inside it.
Reply With Quote
  #4  
Old 01-29-2012, 08:39 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I was talking about the individual widgets (actually I thought they were forum blocks). But I was suggesting you might have to write js to do it, so you could make it work for whichever parts you wanted.
Reply With Quote
  #5  
Old 12-03-2012, 03:17 AM
Haponing Haponing is offline
 
Join Date: Jun 2012
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi.

For some reason our forum block doesn't collapse if the collapse button is clicked. I'm thinking there's something wrong on the FORUMDISPLAY. Any help please?
Reply With Quote
  #6  
Old 01-11-2013, 06:14 PM
sinucello sinucello is offline
 
Join Date: Apr 2006
Location: dutch-german border
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 01-11-2013, 06:39 PM
WorldCraft WorldCraft is offline
 
Join Date: Jun 2010
Posts: 240
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you referring to the built in sidebar on the forumhome? Have you tried adding your content using the AdminCP -> Forums & Moderators -> Forum Blocks Manager?
Reply With Quote
  #8  
Old 07-29-2013, 07:26 PM
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Location: Andover, MN
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
The system is designed to default to expanded, and when a user collapses a block, the name of that block is listed in a cookie. Then when a page loads, a javascript function checks the vb_collapse cookie for a list of blocks that are collapsed and hides them. So you could modify the block_html template to default to collapsed, but since there's no js code that looks to expand collapsed blocks after the page loads, it will always load as collapsed.

You could write your own js to allow for default collapsed blocks, and modify the block_html template (I believe it's the class="collapse" that the built-in vb collpase system looks for). I don't thin k it would be too difficult (unless you don't know any js of course).
vBulletin 4.2.1

You say that the system is designed to default to expanded, but in our forum, the sideblock is collapsed by default. I'd like to know where/how to change this so the sideblock is displayed by default.

Snowhog

Added:

Hmm. Okay, the sidebar does display un-collapsed to guests. I logged out and accessed our forum Home page without logging in, and see the sidebar fully open.

Why, as a logged in user, is the sidebar collapsed. Is it a setting within the AdminCP that I can change?

Added:

Ah, so it is cookie controlled! As the 'guest', and on the Home page and the sideblock displayed, I logged in. The sideblock remained displayed!

Live, experiment, and learn!!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:01 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07998 seconds
  • Memory Usage 2,231KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete