Difference between revisions of "Template:Clade label"

From blackwiki
Jump to navigation Jump to search
imported>Jts1882
(add overflow for now (until main module update))
imported>Jts1882
(move example to documentation →‎top)
 
Line 1: Line 1:
<noinclude>{{clade |style=float:right;
+
<noinclude></noinclude><includeonly>{{#invoke:Clade/labels|label}}</includeonly><noinclude>{{Documentation}}</noinclude>
|label1=root
 
|1={{clade
 
  |1=Leaf 1
 
  |2={{clade
 
      |1=Leaf 2&nbsp;
 
      |sublabelstyle2=overflow:auto; <!--temporary requirement-->
 
      |sublabel2={{clade label|long label placed relatively without stretching the cladogram}}
 
      |2={{clade
 
        |1=Leaf 3&nbsp;
 
        |2=Leaf 4
 
        }}
 
      }}
 
  }}
 
}}</noinclude><includeonly>{{#invoke:Clade/labels|label}}</includeonly><noinclude>{{Documentation}}</noinclude>
 

Latest revision as of 13:43, 8 January 2020

Template documentation[view] [edit] [history] [purge]

This is a utility template for labelling cladograms made with the {{clade}} template. In particular it is for use with |labelN= and |sublabelN= to enable long labels without stretching the cladogram horizontally.

Usage

{{clade label|long label that doesn't stretch the cladogram}}

This returns a label in a div element that is positioned absolutely against the right edge of a parent div element.

Example

DescriptionCodeOutput
Simple long |sublabel=
{{clade 
|label1=root
|1={{clade
   |1=Leaf 1 
   |2={{clade
      |1=Leaf 2  
      |sublabel2=long label that stretches the cladogram
      |2={{clade
         |1=Leaf 3  
         |2=Leaf 4 
         }}
      }}
   }}
}}
root

Leaf 1

Leaf 2 

Leaf 3 

Leaf 4

long label that stretches the cladogram
Use of {{clade label}}
{{clade |style=float:right;
|label1=root
|1={{clade
   |1=Leaf 1 
   |2={{clade
      |1=Leaf 2  
      |sublabel2={{clade label|long label that doesn't stretch the cladogram}}
      |2={{clade
         |1=Leaf 3  
         |2=Leaf 4 
         }}
      }}
   }}
}}
root

Leaf 1

Leaf 2 

Leaf 3 

Leaf 4

long label that doesn't stretch the cladogram