Difference between revisions of "Collapsible Elements - Mediawiki"

From Help Wiki
m (Image toggle using template)
m
Line 1: Line 1:
__NOTOC__
+
===Examples===
====Examples====
+
====Image toggle using Collapsible/Collapsed templates====
<pre><div class="mw-collapsible mw-collapsed">
+
=====Start state is expanded=====
This text is not collapsible; but the next is collapsible and hidden by default:
+
<pre>
<div class="mw-collapsible-content">{{Lorem}}</div>
+
{{Collapsible|Your collapsible content goes here}}
</div>
+
 
</pre>
 
</pre>
 +
Working example of image toggle using <nowiki>{{Collapsible}}</nowiki>
 +
{{Collapsible|Your collapsible content goes here}}
  
<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>
 
 
 
=====Customize toggle text=====
 
 
<pre>
 
<pre>
<div class="mw-collapsible" data-expandtext="show more" data-collapsetext="hide me">
+
{{Collapsible|More of your collapsible content goes here
This text is not collapsible; but the next is collapsible and hidden by default:
+
*it can even
<div class="mw-collapsible-content">{{Lorem}}</div>
+
*have a
</div>
+
*bulleted list
 +
}}
 
</pre>
 
</pre>
 +
{{Collapsible|More of your collapsible content goes here
 +
*it can even
 +
*have a
 +
*bulleted list
 +
}}
  
 
+
=====Start state is collapsed=====
<div class="mw-collapsible mw-collapsed" 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>
+
 
+
=====Toggle outside of collapsible element=====
+
 
<pre>
 
<pre>
<div class="mw-customtoggle-myToggle1" style="cursor:pointer; color:blue">[+/-] Click here to toggle</div>
+
{{Collapsed|My collapsed content goes here}}
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-myToggle1">
+
<div class="toccolours mw-collapsible-content">{{Lorem}}</div>
+
</div>
+
 
</pre>
 
</pre>
<div class="mw-customtoggle-myToggle1" style="cursor:pointer; color:blue">[+/-]Clicking here will toggle</div>
+
{{Collapsed|My collapsed content goes here}}
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-myToggle1">
+
<div class="toccolours mw-collapsible-content">{{Lorem}}</div>
+
</div>
+
  
  
 
=====Toggle using image=====
 
=====Toggle using image=====
 +
This is what the Collapsible/Collpased templates are based upon
 
<pre>
 
<pre>
 
<div class="collapse-pre-one mw-collapsible">
 
<div class="collapse-pre-one mw-collapsible">
Line 63: Line 52:
 
</div>
 
</div>
  
=====Image toggle using template=====
+
====Default collapsible elements====
'''Start state is expanded'''
+
<pre><div class="mw-collapsible mw-collapsed">
<pre>
+
This text is not collapsible; but the next is collapsible and hidden by default:
{{Collapsible|Your collapsible content goes here}}
+
<div class="mw-collapsible-content">{{Lorem}}</div>
 +
</div>
 
</pre>
 
</pre>
{{Collapsible|Your collapsible content goes here}}
 
  
<pre>
+
<div class="mw-collapsible mw-collapsed">
{{Collapsible|More of your collapsible content goes here
+
This text is not collapsible; but the next is collapsible and hidden by default:
*it can even
+
<div class="mw-collapsible-content">{{Lorem}}</div>
*have a
+
</div>
*bulleted list
+
}}
+
</pre>
+
{{Collapsible|More of your collapsible content goes here
+
*it can even
+
*have a
+
*bulleted list
+
}}
+
  
'''Start state is collapsed'''
 
<pre>
 
{{Collapsed|My collapsed content goes here}}
 
</pre>
 
{{Collapsed|My collapsed content goes here}}
 
  
====Additional Notes:====
+
=====Customize toggle text=====
*Not an extension but a built into core. See http://www.mediawiki.org/wiki/ResourceLoader/Default_modules#jquery.makeCollapsible
+
*'''Default toggle text''' reside at: [[Mediawiki:collapsible-expand]] and [[Mediawiki:collapsible-collapse]]
+
*[http://test.wikipedia.org/wiki/User:Krinkle/CollapsingTestpageMw More examples of collapsible text].
+
*The image toggle is working in conjunction with the following theme CSS:
+
 
<pre>
 
<pre>
.collapse-pre-one .mw-collapsible-toggle .up, .collapse-pre-one.mw-collapsed .mw-collapsible-toggle .down {
+
<div class="mw-collapsible" data-expandtext="show more" data-collapsetext="hide me">
    display: none;
+
This text is not collapsible; but the next is collapsible and hidden by default:
}
+
<div class="mw-collapsible-content">{{Lorem}}</div>
.collapse-pre-one .mw-collapsible-toggle .down, .collapse-pre-one.mw-collapsed .mw-collapsible-toggle .up {
+
</div>
    display: block;
+
    margin-right:.5em;
+
}
+
 
</pre>
 
</pre>
  
  
 +
<div class="mw-collapsible mw-collapsed" 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>
  
[[Category:Mediawiki]]
+
=====Toggle outside of collapsible element=====
 +
<pre>
 +
<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>
 +
</pre>
 +
<div class="mw-customtoggle-myToggle1" style="cursor:pointer; color:blue">[+/-]Clicking here will toggle</div>
 +
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-myToggle1">
 +
<div class="toccolours mw-collapsible-content">{{Lorem}}</div>
 +
</div>
 +
[[category:Mediawiki]]

Revision as of 13:08, 25 June 2013

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.