Go Back   vb.org Archive > vBulletin Modifications > vBulletin 5.x Modifications > vBulletin 5.x Template Modifications
Forum Collapse using JQuery Details »»
Forum Collapse using JQuery
Version: 1.00, by godarmy godarmy is offline
Developer Last Online: Nov 2014 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 5.0.x Rating:
Released: 07-17-2013 Last Update: Never Installs: 8
Template Edits
Re-useable Code  
No support by the author.

Make Forum item and forum list collapseable

Add new template --> name it as you want (in this i called forum_collapse--> and then put this code

Code:
<script type="text/javascript">
jQuery(document).ready(function () {
        jQuery(".forum-list-container .forum-item").show();
        jQuery("tr.subforum-list").show();
        //toggle the componenet with class msg_body
        jQuery("TR.category-header").click(function () {
                    jQuery(this).nextUntil(".forum-list-container .forum-item").fadeToggle(100);
                    jQuery(this).next("tr.subforum-list").fadeToggle(100);
                    jQuery(this).nextUntil("TR.category-header").fadeToggle(100);
                });
});       
</script>
and then...

edit template header...and find this line
Code:
<script type="text/javascript" src="{vb:raw jqueryurl}"></script>
<script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="{vb:raw baseurl}/js/jquery/jquery-{vb:raw jqueryversion}.min.js"><\/script>');</script>
and then...add this line...after below line
Code:
<vb:if condition="$page['channelid'] == 1 OR $page['channelid'] == 1" />
{vb:template forum_collapse}
</vb:if>
also we can combine it.. with css to do some animation like folder tree

Best Regards

Godarmy

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-20-2013, 06:06 AM
napy8gen napy8gen is offline
 
Join Date: Jan 2006
Location: port ++++son
Posts: 519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the jquery is now in footer template.

Quote:
<vb:if condition="$page['channelid'] == 1 OR $page['channelid'] == 1" />
should not have closed tag at the end

Quote:
<vb:if condition="$page['channelid'] == 1 OR $page['channelid'] == 1" >
it would be great is is using default vb5 collapse slide animation and collapse button
Reply With Quote
  #3  
Old 03-19-2014, 12:48 AM
SirPereira SirPereira is offline
 
Join Date: Jan 2010
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can we have a possible demo or screenshot please?
Reply With Quote
  #4  
Old 09-25-2014, 01:45 AM
hkwibawa hkwibawa is offline
 
Join Date: Sep 2014
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

it works for me ( using vb 5 ) ....
and how can I make the sub forums in a state of collapse on the main page so that it does not require a lot of scrolling because of the many sub forums ?

thanks in advance
Reply With Quote
  #5  
Old 11-18-2015, 01:34 PM
Hectorsky's Avatar
Hectorsky Hectorsky is offline
 
Join Date: Mar 2015
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

which header template? i didn't found that code in header template
Reply With Quote
  #6  
Old 01-10-2021, 07:05 PM
eroyka eroyka is offline
 
Join Date: Apr 2008
Location: Pisa
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Hectorsky View Post
which header template? i didn't found that code in header template
Not in header... is in footer template.
Reply With Quote
Reply

Thread Tools

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 10:17 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04355 seconds
  • Memory Usage 2,263KB
  • Queries Executed 22 (?)
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
  • (3)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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