Difference between revisions of "Collapsible Elements - Mediawiki"

From Help Wiki
m (subst applied to Template:TwoColumn)
Line 1: Line 1:
{{TwoColumn|lead=
+
 
 +
<div class="container-fluid">
 +
<div class="row">
 +
<div class="col-md-8">
 +
<div class="lead">
 
Examples of collapsable templates.
 
Examples of collapsable templates.
|content=
+
</div>
 +
 
 
===Examples===
 
===Examples===
 
====Image toggle using Collapsible/Collapsed templates====
 
====Image toggle using Collapsible/Collapsed templates====
Line 93: Line 98:
 
<div class="toccolours mw-collapsible-content">{{Lorem}}</div>
 
<div class="toccolours mw-collapsible-content">{{Lorem}}</div>
 
</div>
 
</div>
|sidebar=
+
 
 +
 
 +
<!-- end col-md-8 -->
 +
</div>
 +
<div class="col-md-1"></div>
 +
<div class="col-md-3 sidebar">
 
{{Mediawiki Help}}
 
{{Mediawiki Help}}
 
{{GetHelp}}
 
{{GetHelp}}
}}
+
 
 +
<!-- end col-md-3-->
 +
</div>
 +
<!-- end row-->
 +
</div>
 +
<!-- end container-->
 +
</div>
 +
<!-- Generator=Template:TwoColumn -->
 +
__NOTOC__
 +
__NOEDITSECTION__
 
[[category:Mediawiki]]
 
[[category:Mediawiki]]
 
__NOTOC__
 
__NOTOC__
 
__NOEDITSECTION__
 
__NOEDITSECTION__

Revision as of 16:01, 14 August 2017

Examples of collapsable templates.

Examples

Image toggle using Collapsible/Collapsed templates

Start state is expanded
{{Collapsible|Your collapsible content goes here}}

Working example of image toggle using {{Collapsible}}

Collapse-small-silver.png
show less
Expand-small-silver.png
show more

Your collapsible content goes here

{{Collapsible|More of your collapsible content goes here
*it can even
*have a 
*bulleted list
}}
Collapse-small-silver.png
show less
Expand-small-silver.png
show more

More of your collapsible content goes here

  • it can even
  • have a
  • bulleted list
Start state is collapsed
{{Collapsed|My collapsed content goes here}}
Collapse-small-silver.png
show less
Expand-small-silver.png
show more

My collapsed content goes here


Toggle using image

This is what the Collapsible/Collpased templates are based upon

<div class="collapse-pre-one mw-collapsible">
   <div class="mw-collapsible-toggle" style="float: none;">
   <span class="down">[[File:Collapse-small-silver.png|12px|left|link=]] show less</span>
   <span class="up">[[File:Expand-small-silver.png|12px|left|link=]] show more</span>
   </div>
<div class="mw-collapsible-content">
{{Lorem}}
</div>
</div>
Collapse-small-silver.png
show less
Expand-small-silver.png
show more

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Default collapsible elements

<div class="mw-collapsible mw-collapsed">
This text is not collapsible; but the next is collapsible and hidden by default:
<div class="mw-collapsible-content">{{Lorem}}</div>
</div>

This text is not collapsible; but the next is collapsible and hidden by default:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


Customize toggle text
<div class="mw-collapsible" data-expandtext="show more" data-collapsetext="hide me">
This text is not collapsible; but the next is collapsible and hidden by default:
<div class="mw-collapsible-content">{{Lorem}}</div>
</div>


This text is not collapsible; but the next is collapsible and hidden by default:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Toggle outside of collapsible element
<div class="mw-customtoggle-myToggle1" style="cursor:pointer; color:blue">[+/-] Click here to toggle</div>
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-myToggle1">
<div class="toccolours mw-collapsible-content">{{Lorem}}</div>
</div>
[+/-]Clicking here will toggle
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.