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)
-   -   Miscellaneous Hacks - Making something collapsible inside templates, using collapsible block (https://vborg.vbsupport.ru/showthread.php?t=320926)

Alan_SP 11-28-2015 10:00 PM

Making something collapsible inside templates, using collapsible block
 
1 Attachment(s)
Well, sometimes we want to make something collapsible, so users can see it, or not, depending on their wishes.

To make some HTML code collapsible in vB4, you need to use this code:

Code:

<div class="block collapse" id="unique id name">
        <h2 class="blockhead">Name of the block, can be phrase, can be hardcoded

<a class="collapse" id="collapse_unique name" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse{vb:raw vbcollapse.collapseimg_cel_dummy_img}_40b.png" alt="{vb:rawphrase collapse_this_category}" /></a>

</h2>
        <div class="blockbody settings_form_border" id="unique name">

-------------here goes code that you want inside collapsible block, whatever it is --------------

        </div>
</div>

In upper example I used CODE BBtag so I can use color BBcode, so you can see in red what are variables you can (and have to) change to suit your needs. The two unique names in green must be the same that collapsing work.

This is most universal example, you can also have ordered list, than you have something like this:

Code:

<div class="block collapse" id="unique id name">
        <h2 class="blockhead">Name of the block, can be phrase, can be hardcoded

<a class="collapse" id="collapse_unique name" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse{vb:raw vbcollapse.collapseimg_cel_dummy_img}_40b.png" alt="{vb:rawphrase collapse_this_category}" /></a>

</h2>
        <ol class="blockbody settings_form_border" id="unique name">

-------------here goes code that you want inside collapsible block, whatever it is --------------

        </ol>
</div>

For example, you can use for code there: {vb:raw infractionbits} or {vb:raw reputationcommentbits} or something similar.

One example you can find here: https://vborg.vbsupport.ru/showthread.php?t=278884 Here I made collapsible block of usernotes in user profile.


All times are GMT. The time now is 03:56 PM.

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.00930 seconds
  • Memory Usage 1,713KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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