Module:Clade/hidden/doc: Difference between revisions
add link to manual on collapsible elements |
add an infobox (will move later) |
||
Line 1: | Line 1: | ||
{{Module rating |beta<!-- Values: pre-alpha • alpha • beta • release • protected -- If a rating not needed/relevant, delete this template call -->}} |
{{Module rating |beta<!-- Values: pre-alpha • alpha • beta • release • protected -- If a rating not needed/relevant, delete this template call -->}} |
||
{{Infobox |
|||
|abovestyle=background:#2222aa;color:#ffffff; |
|||
|bodystyle="background:#dddd00;border:#ff0000 solid 1px;" |
|||
|headerstyle=background:#ccccff; |
|||
|rowstyle=background:#eeeeff; |
|||
|datastyle=text-align:left; |
|||
|above=Clade System |
|||
|subheader=Templates and modules for generating cladograms |
|||
|header1=Modules |
|||
|data2= |
|||
*[[Module:Clade]] |
|||
*[[Module:Clade/hidden]] |
|||
*[[Module:Clade/gallery]] |
|||
*[[Module:Clade/example]] |
|||
*[[Module:Clade/transclude]] |
|||
|header3=Related templates |
|||
|data4= |
|||
*{{tl|Clade}} |
|||
*{{tl|CladeR}} |
|||
*{{tl|Clade hidden}} |
|||
*{{tl|Clade gallery}} |
|||
*{{tl|Clade example}} |
|||
*{{tl|Clade box}} |
|||
*{{tl|Clade transclude section}} |
|||
|header5=Useful help |
|||
|data6= |
|||
*[[:mw:Manual:Collapsible_elements]] |
|||
}} |
|||
This module contains the code for {{tl|Clade hidden}} |
This module contains the code for {{tl|Clade hidden}} |
||
Useful help page: |
Useful help page: |
||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> |
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> |
||
Line 15: | Line 44: | ||
}}</includeonly> |
}}</includeonly> |
||
{{clear}} |
|||
== Documentation transcluded from the template== |
== Documentation transcluded from the template== |
||
{{Template:Clade hidden/doc}} |
{{Template:Clade hidden/doc}} |
Revision as of 17:19, 4 November 2019
Clade System | |
---|---|
Templates and modules for generating cladograms | |
Modules | |
Related templates | |
| |
Useful help | |
This module contains the code for {{Clade hidden}}
Useful help page:
Usage
{{#invoke:Clade/hidden|hidden}}
Documentation transcluded from the template
![]() | This module depends on the following other modules: |
![]() | This module uses TemplateStyles: |
Creates an interactive clade element that is collapsible. The initial state can be collapsed (hidden) or expanded (visible). Interactivity is achieved by clicking appropriate symbols in the cladogram (e.g. ⊞ or ⊟) or custom interactive elements can be added externally with {{clade toggle}}.
This feature is intended to be used sparsely on large clagograms where the whole structure cannot be seen in the screen window.
Parameters
Parameters as {{clade}} with the addition of the following:
|expanded=true
– sets initial state to expanded (default: hidden)|id=
– id to control interactivity; use unique ids for independent behaviour or same ids for shared behaviour|expand-symbol=
– symbol for expansion (e.g. ⊞ --> ⊞ or ⨁ --> ⨁)|collapse-symbol=
– symbol for collapsing (e.g. ⊟ --> ⊟ or ⨂ -->⨂)|mode=left
– position of collapse symbol (left or right of the clade content; default: left)|expand-text=(expand text)
– text to replace hidden content|collapse-text=(collapse text)
– text to show with collapse symbol (when|mode=right
)
Development note: The behaviour of the hidden element when in mobile mode or with javascript disable is controlled in {{clade hidden/styles.css}}. The currentl behaviour is to hide the symbols and leave the expanded content. The following CSS code can hide the content in these modes. However there are currently a couple of issues: width of labels on collapsed elements if on dummy clade; initial state of content when |expanded=true
.
table.clade td.clade-interactive div.mw-collapsible-content { display:none; }
Examples
Code | Output | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{Clade
|label1=root
|1={{Clade
|1=Unhidden Leaf
|label2=Hidden clade
|2={{Clade hidden |id=1
|1=Leaf1
|2=Leaf2
}}
}}
}}
|
| ||||||||||||||||||
{{Clade
|label1=root
|1={{Clade
|1=Unhidden Leaf
|label2=Collapsible clade
|2={{Clade hidden
|id=2 <!-- clade hidden parameters -->
|expanded=true
|mode=right
|expand-text=(expand text)
|collapse-text=(collapse text)
|expand-symbol=⨁
|collapse-symbol=⨂
|1=Leaf1 <!-- standard clade parameters -->
|2=Leaf2
}}
}}
}}
|
|