Difference between revisions of "Template:Clade box"
Jump to navigation
Jump to search
imported>Jts1882 (add tests) |
imported>Jts1882 (test horizontal scrolling→top) |
||
| Line 1: | Line 1: | ||
<noinclude>{{clade box | <noinclude>{{clade box | ||
|text=This text is not collapsible; but the next div element is collapsible and hidden by default. | |text=This text is not collapsible; but the next div element is collapsible and hidden by default. | ||
| − | |content= {{clade |label1=Label |1={{clade |1=Leaf1 |2=Leaf2 }} }} | + | |content={{clade |label1=Label |1={{clade |1=Leaf1 |2=Leaf2 }} }} |
}} | }} | ||
{{clade box|caption = Example with title | {{clade box|caption = Example with title | ||
| Line 14: | Line 14: | ||
|text= There is an issue when no nested clade. In this case an outer templatestyles is wrapped in an <pre> element. When there is a nested clade the templatestyles isn't placed before the outer clade table. | |text= There is an issue when no nested clade. In this case an outer templatestyles is wrapped in an <pre> element. When there is a nested clade the templatestyles isn't placed before the outer clade table. | ||
|content={{cladeN |1=Leaf1 |2=Leaf2 }} | |content={{cladeN |1=Leaf1 |2=Leaf2 }} | ||
| + | vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | ||
}} | }} | ||
| + | |||
</noinclude><includeonly><!-- prototype <div> version; using Nav frame for colours--> | </noinclude><includeonly><!-- prototype <div> version; using Nav frame for colours--> | ||
<div style="width:{{{width|100%}}};border:{{{border|solid 1px #008}}};padding:0.2em;"> | <div style="width:{{{width|100%}}};border:{{{border|solid 1px #008}}};padding:0.2em;"> | ||
| − | {{#if:{{{caption|{{{title|}}}}}}|<div style="text-align:center;font-weight:bold;background:{{{bgcolor|# | + | {{#if:{{{caption|{{{title|}}}}}}|<div style="text-align:center;font-weight:bold;background:{{{bgcolor|#ccf}}};">{{{caption|{{{title|Needs a title}}}}}}</div>|}} |
<div class="mw-collapsible {{#if:{{{show}}}|mw-collapsed|}}" style="padding:0.5em 2em;">{{{text| }}} | <div class="mw-collapsible {{#if:{{{show}}}|mw-collapsed|}}" style="padding:0.5em 2em;">{{{text| }}} | ||
| − | <div class="mw-collapsible-content" >{{{content|{{{1|Need some content}}}}}}</div> | + | <div class="mw-collapsible-content" style="overflow:auto;max-width:2000px;">{{{content|{{{1|Need some content}}}}}}</div> |
</div> | </div> | ||
</div> | </div> | ||
Revision as of 17:49, 18 November 2019
This text is not collapsible; but the next div element is collapsible and hidden by default.
| Label |
| ||||||
Example with title
This text is not collapsible; but the next div element is collapsible and hidden by default.
|
Leaf1 | |
|
Leaf2 | |
CladeN version to test quirk in code.
| Label |
| ||||||
Example with title (and clade N)
There is an issue when no nested clade. In this case an outer templatestyles is wrapped in an <pre> element. When there is a nested clade the templatestyles isn't placed before the outer clade table.
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
Leaf1 | |
|
Leaf2 | |
Create a simple collapsable box to display large cladograms.
Usage
{{clade box
|caption = Title or caption
|text = This text is not collapsible; but the next div element is collapsible and hidden by default:
|color=#F0F2F5
|border=solid 1px #aaa
|width=100%
|content={{clade
|label1=Label
|1={{clade
|1=Leaf1
|2=Leaf2
}}
}}
}}
Title or caption
This text is not collapsible; but the next div element is collapsible and hidden by default:
| Label |
| ||||||
Parameters
|caption=– caption to include in box header|color=– background color for box header (default: #F0F2F5)|border=– CSS properties of box border (default: solid 1px #aaa)|width=– width of box (default: 100%)|show=– if parameter present the initial state of the box is expanded (default: collapsed)|content=– the content of the box (usually a large cladogram)|text=– text to show in the box before the collapsed content
| The above documentation is transcluded from Template:Clade box/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |