vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Making Boxes Collapsible (https://vborg.vbsupport.ru/showthread.php?t=221565)

BRotondi 06-25-2010 07:18 PM

Quote:

Originally Posted by cellarius (Post 2059521)
To avoid confusion: You export as xml.

Oups... :) Thanks for the hint! (repaired)

Another Question: Is there a simple way to make a div collapsed by default?

cellarius 06-25-2010 08:06 PM

Quote:

Originally Posted by BRotondi (Post 2059527)
Another Question: Is there a simple way to make a div collapsed by default?

You may want to read the article ;)

BRotondi 06-25-2010 09:07 PM

Oups... Sorry... I should have asked "Did anyone found a non-dirty quick solution?" (but anyway the answer will be "no", since it would be written in the article...)

cellarius 06-26-2010 08:38 AM

Quote:

Originally Posted by BRotondi (Post 2059570)
(but anyway the answer will be "no", since it would be written in the article...)

at least if I knew of it ;)

BRotondi 06-26-2010 11:43 AM

O.K. here an example with an own script: When registering, "Additional Infos" will be collapsed:

Replace in Template register
Code:

<h3 class="blocksubhead">{vb:rawphrase additional_information}</h3>
with
Code:

<script type="text/javascript">
    function RegistryDetailsOn (setcookie) {
        $("#registry_details").css({ "display": "" });
        $("#registry_details_link").css({ "background": "url('images/buttons/collapse_40b.png') no-repeat scroll 0 0 transparent","padding-left": "17px"});

        _set_cookie('RegistryDetails_visible', 1, setcookie);
    }
    function RegistryDetailsOff (setcookie) {
        $("#registry_details").css({ "display": "none" });
        $("#registry_details_link").css({ "background": "url('images/buttons/collapse_40b_collapsed.png') no-repeat scroll 0 0 transparent","padding-left": "17px" });
   
        _set_cookie('RegistryDetails_visible', 0, setcookie);
    }
    function RegistryDetailsInit () {
        t = fetch_cookie('RegistryDetails_visible');
        if (t=="1") {
            RegistryDetailsOn(0);
        } else {
            RegistryDetailsOff(0);
        }
    }
    function RegistryDetailsSwitch () {
        if ($("#registry_details").css("display") == "none") {
            RegistryDetailsOn();
        } else {
            RegistryDetailsOff();
        }
    }
    function _set_cookie(variable, wert, setzen) {
        if (!(setzen==0)) {
            set_cookie(variable, wert);
        }
    }
    $(document).ready(function(){
        RegistryDetailsInit();
    });
</script>

<h3 class="blocksubhead"><a href="javascript:RegistryDetailsSwitch()" id="registry_details_link">{vb:rawphrase additional_information}</a></h3>
<div id="registry_details">

and
Code:

            {vb:raw customfields_other}
        </div>

with
Code:

            {vb:raw customfields_other}
        </div>
        </div>

This Solution uses jQuery and the vB-Cookie-Routines. The Script could be reduced to one switch-line, but this way you have all possibilities for more extended issues.

Regards, Bruno

emath 10-26-2010 01:26 PM

how do i combine it within a table?

like, i dont want to use div, to insert the classes and everything to the <table class=..

cellarius 10-26-2010 06:14 PM

Wrap a div around your table.

dtorreci 11-23-2010 06:18 PM

Hi all,

just a quick question I would like to make my postbit fields collapsable, I have follow the steps provided at page 1 and well it works but only with first post how should I proceed to make it work with all post ?

TIA

cellarius 11-23-2010 06:45 PM

You would have to add something unique to the collapsing id (cel_dummy in the example). You coud try the postid (cel_dummy_{vb:raw post.postid}).

MyLibary 07-15-2011 07:12 PM

how do i add id for blocks in vbCMS 4.1.4?, they dont have any id..


All times are GMT. The time now is 11:34 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.01579 seconds
  • Memory Usage 1,742KB
  • 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
  • (4)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete