Difference between revisions of "Template:Show"

From Sugar Labs
Jump to navigation Jump to search
m (simplify parameter name)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div class="NavFrame {{{collapsed|collapsed}}}"><div class="NavHead">{{{1}}} </div><div class="NavContent">{{{2}}}</div></div></includeonly><noinclude>{{TOCright}}
+
<includeonly><div class="mw-collapsible {{{collapsed|mw-collapsed}}}" data-collapsetext="hide&nbsp;▲" data-expandtext="show&nbsp;▼">{{{1}}} <div class="mw-collapsible-content">{{{2}}}</div></div></includeonly><noinclude>
  
This template produces a [show]/[hide] frame that can be hidden or shown on initial display of a wiki page.
+
This template produces a [show ]/[hide ] frame that can be hidden or shown on initial display of a wiki page.
  
 
==Usage==
 
==Usage==
<big><code><nowiki>{{Show|collapsed=collapsed|headline|content}}</nowiki></code></big>
+
<code><nowiki>{{Show|collapsed=mw-collapsed|headline|content}}</nowiki></code>
  
 
Required parameters:
 
Required parameters:
Line 12: Line 12:
 
Optional, named parameter:
 
Optional, named parameter:
 
# collapsed -- may have one of 2 possible values:
 
# collapsed -- may have one of 2 possible values:
#* collapsed -- (the default) -- hides the content and produces a [show] link after the headline
+
#* mw-collapsed -- (the default) -- hides the content and produces a [show ] link after the headline
#* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- (nothing) entered as <big><code>|collapsed=|</code></big> -- the content will show below the header, which will have a [hide] link next to it.
+
#* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- (nothing) entered as <big><code>|collapsed=|</code></big> -- the content will show below the header, which will have a [hide ] link next to it.
  
 +
* See [[Template:Iframe]] for a way to show/hide full web pages.
 
==Example==
 
==Example==
  
<big>
+
<span style="white-space:pre-wrap"><nowiki>{{Show|collapsed=|Terminal output log: |<pre>[root@Dell-8400 ~]# df -Th
<pre><nowiki>{{Show|[http://activities.sugarlabs.org Sugar Activity Library]|{{Iframe
+
Filesystem    Type    Size  Used Avail Use% Mounted on
|[http://activities.sugarlabs.org Sugar Activity Library]
+
/dev/sda1    ext4    18G  11G  6.8G  61% /
|http://activities.sugarlabs.org
+
tmpfs        tmpfs    1.6G  908K  1.6G  1% /dev/shm
|900|600|1}}
+
/dev/sda2    vfat    20G  17G  2.8G  86% /media/VMs
}}</nowiki>
+
/dev/sde1    vfat    996M  443M  554M  45% /media/LG
</pre></big>
+
/dev/sdc1    vfat    15G  1.5G  14G  10% /media/TOSHI
{{Show|[http://activities.sugarlabs.org Sugar Activity Library]|{{#widget:Iframe
+
/dev/sdd1    vfat    15G  673M  15G  5% /media/SANDY
|url=http://activities.sugarlabs.org
+
[root@Dell-8400 ~]#
|width=900
+
</pre>}}</nowiki></span>
|height=600
+
 
|border=1}}
+
{{Show|mw-collapsed=|Terminal output log: |<pre>[root@Dell-8400 ~]# df -Th
 +
Filesystem    Type    Size  Used Avail Use% Mounted on
 +
/dev/sda1    ext4    18G  11G  6.8G  61% /
 +
tmpfs        tmpfs    1.6G  908K  1.6G  1% /dev/shm
 +
/dev/sda2    vfat    20G  17G  2.8G  86% /media/VMs
 +
/dev/sde1    vfat    996M  443M  554M  45% /media/LG
 +
/dev/sdc1    vfat    15G  1.5G  14G  10% /media/TOSHI
 +
/dev/sdd1    vfat    15G  673M  15G  5% /media/SANDY
 +
[root@Dell-8400 ~]#
 +
</pre>
 
}}
 
}}
  
*
 
 
</noinclude>
 
</noinclude>

Latest revision as of 22:01, 6 November 2013


This template produces a [show ▼]/[hide ▲] frame that can be hidden or shown on initial display of a wiki page.

Usage

{{Show|collapsed=mw-collapsed|headline|content}}

Required parameters:

  1. headline - the line of wiki text, for example, a link to remote content or just a header
  2. content - the content wiki text. It may be another template for transclusion of a page or embedding of an external page, or just plain content that you want the reader to be able to expand or collapse.

Optional, named parameter:

  1. collapsed -- may have one of 2 possible values:
    • mw-collapsed -- (the default) -- hides the content and produces a [show ▼] link after the headline
    •                 -- (nothing) entered as |collapsed=| -- the content will show below the header, which will have a [hide ▲] link next to it.

Example

{{Show|collapsed=|Terminal output log: |<pre>[root@Dell-8400 ~]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda1 ext4 18G 11G 6.8G 61% / tmpfs tmpfs 1.6G 908K 1.6G 1% /dev/shm /dev/sda2 vfat 20G 17G 2.8G 86% /media/VMs /dev/sde1 vfat 996M 443M 554M 45% /media/LG /dev/sdc1 vfat 15G 1.5G 14G 10% /media/TOSHI /dev/sdd1 vfat 15G 673M 15G 5% /media/SANDY [root@Dell-8400 ~]# </pre>}}

Terminal output log:
[root@Dell-8400 ~]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext4     18G   11G  6.8G  61% /
tmpfs        tmpfs    1.6G  908K  1.6G   1% /dev/shm
/dev/sda2     vfat     20G   17G  2.8G  86% /media/VMs
/dev/sde1     vfat    996M  443M  554M  45% /media/LG
/dev/sdc1     vfat     15G  1.5G   14G  10% /media/TOSHI
/dev/sdd1     vfat     15G  673M   15G   5% /media/SANDY
[root@Dell-8400 ~]#