Difference between revisions of "Template:Clade hidden/doc"

From blackwiki
Jump to navigation Jump to search
imported>Jts1882
(update →‎top)
imported>Pppery
(Does not directly use Template:Clade/styles.css; does so via an internal call to Module:Clade -- the documentation on Template:Clade is sufficient)
 
Line 2: Line 2:
 
<!-- 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]]) -->
 
{{Lua|Module:Clade|Module:Clade/hidden}}
 
{{Lua|Module:Clade|Module:Clade/hidden}}
{{Uses TemplateStyles|Template:Clade/styles.css|Template:Clade hidden/styles.css}}
+
{{Uses TemplateStyles|Template:Clade hidden/styles.css}}
  
 
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. &#8862; or &#8863;) or custom interactive elements can be added externally with {{tl|clade toggle}}.
 
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. &#8862; or &#8863;) or custom interactive elements can be added externally with {{tl|clade toggle}}.

Latest revision as of 03:38, 11 November 2019

Script error: No such 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. &#8862; --> ⊞ or &#10753; --> ⨁)
  • |collapse-symbol= – symbol for collapsing (e.g. &#8862; --> ⊞ or &#10754; -->⨂)
  • {{para|mode=left – position of collapse symbol (left or right of the clade content; default: left)
  • {{para|expand-text=(expand text) – text to replace hidden content
  • {{para|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

CodeOutput
{{Clade
|label1=root
|1={{Clade
   |1=Unhidden Leaf
   |label2=Hidden clade
   |2={{Clade hidden  |id=1
      |1=Leaf1
      |2=Leaf2
      }}
   }}
}}
root

Unhidden Leaf

Hidden clade

Leaf1

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
      }}
   }}
}}
root

Unhidden Leaf

Collapsible clade
⨁(expand text)

Leaf1

Leaf2

⨂(collapse text)