vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Forum Home Enhancements - Collapse the "What's Going On?" Block (https://vborg.vbsupport.ru/showthread.php?t=277787)

gezuvor 01-29-2012 11:00 PM

Collapse the "What's Going On?" Block
 
1 Attachment(s)
Hi all,

I was struggling with a way to add the collapse button to my What's Going On? block and found an Article by cellarius that got me on the right track.

That was a good start, but I am a little OCD and did some additional fiddling to make it as vB-compliant as possible. Once I had it done and tested, I figured I would share with the rest of the community with the expectation that somebody else would want to use it to.

There is one edit to FORUMHOME and some new CSS, but that is it.

I performed this modification on a stock 4.1.10 installation, but it should work on any of the 4.1.x versions. If you have a custom theme/skin, some additional work may be required but the concept is the same...

Anyway, here goes!

In FORUMHOME, look for:
Code:

                <h2 class="blockhead">{vb:rawphrase whats_going_on}</h2>
                <div class="blockbody formcontrols floatcontainer">

Replace with:
Code:

                <h2 class="blockhead">
                <span>{vb:rawphrase whats_going_on}</span>
                <vb:if condition="!$show['collapsable_forums']">
                        <a class="collapse" id="collapse_whats_going_on" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse_40b.png" alt="" /></a>
                </vb:if>
                </h2>
                <div id="whats_going_on" class="blockbody formcontrols floatcontainer">


Open additional.css and add this to the bottom (or where it seems to best fit):
Code:

.wgo_block .blockhead a.collapse {
        position: absolute;
        top: {vb:math {vb:math {vb:math {vb:stylevar padding}+{vb:math  {vb:stylevar mid_fontSize}*{vb:stylevar line_height}}-13}/2}+1};
}

.wgo_block .blockhead a.collapse img {
/* values are based on the image */
        position:absolute;
        {vb:stylevar right}: -{vb:math {vb:stylevar padding} * 0.6};
        display:block;
        width:13px;
        height:13px;
        overflow:hidden;
        float: {vb:stylevar right};
        clear: {vb:stylevar left};
}

That's it, you're done!

I hope this is useful and I welcome feedback!

foudu1030 01-30-2012 06:08 PM

Any screenshot ? :)
Thanks

gezuvor 01-30-2012 06:42 PM

It's pretty basic, but I added some screenshots for you!

foudu1030 01-30-2012 07:49 PM

Thanks, Installed !
(Sorry, but I speak not good english)

prandah 01-30-2012 08:50 PM

installed
work with 4.1.10

abdobasha2004 01-31-2012 09:41 AM

nice idea
but little bit complicated to do

billstelling 02-02-2012 06:41 AM

complicated.. that's funny.. This is an easy template mod.

Great job with this one!

BlueCheri 02-02-2012 06:51 AM

Good work, installed.

Working fine.

Thanx

Taurus1 02-02-2012 08:48 AM

Really great work! Works perfect. Thanks.

alasiri 04-29-2012 04:32 AM

great idea thanks ...

Calystos 06-04-2012 07:23 AM

If anyone uses the Nexia's Forum Sidebar Everywhere product make sure to also edit the FORUMHOME_NEX_SIDEBAR template too! Else it'll be ignored and the WGO box will use the non-collapsible format.

Confirmed to work on vB v4.2.0, working great, thanks!

faisaly.com 06-04-2012 11:04 AM

Works perfect vb4.1.11 thanks for the template edit...

NTT 08-26-2012 07:36 PM

Works perfect vb4.2.0 PL2

Naijasite 02-19-2013 10:25 PM

how do i make it to collapsed by default during page load. i noticed i have to click on the collapse button before it will collapsed.

Dorgham 02-25-2013 05:40 PM

Good job :)

Naijasite 04-04-2013 10:32 PM

how do i make it collapse on page load for every user by default?

VonDoom 04-22-2013 03:56 AM

Quote:

Originally Posted by Naijafinder (Post 2414312)
how do i make it collapse on page load for every user by default?

+1 for this request.. Im using sidebar blocks to replace most of WGO but i didnt want to remove it permanently so loading it collapsed would be a plus under such circumstances..

stevieb 07-31-2013 08:38 PM

I found the button to collapse too high, so I literally added the following in the additionalcss which aligns it perfect in the middle of the block:

Code:

top:-5px;

Full code (additionalcss)

Code:

.wgo_block .blockhead a.collapse {
        position: absolute;
        top: {vb:math {vb:math {vb:math {vb:stylevar padding}+{vb:math  {vb:stylevar mid_fontSize}*{vb:stylevar line_height}}-13}/2}+1};
}

.wgo_block .blockhead a.collapse img {
/* values are based on the image */
        position:absolute;
        {vb:stylevar right}: -{vb:math {vb:stylevar padding} * 0.6};
        display:block;
        width:13px;
        height:13px;
        overflow:hidden;
      top:-5px;
        float: {vb:stylevar right};
        clear: {vb:stylevar left};
}



All times are GMT. The time now is 04:44 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.01293 seconds
  • Memory Usage 1,753KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete