Difference between revisions of "Template:Chart top"

From blackwiki
Jump to navigation Jump to search
imported>Neveselbert
m (Reduce per Module:Ahnentafel)
imported>SMcCandlish
(This cannot auto-collapse by default, per MOS:DONTHIDE. It should never be auto-collapsed on purpose in mainspace with this parameter, either, for the same reason. Collapsing stuff is potentially less objectionable in other namespaces. See also MOS:ACCESS for usability and accessibility issues. And use Template:Yesno-no, to interpret values like "Y", "false", etc. Also permit "collapse" not just "collapsed".)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| class="collapsible {{#ifeq:{{{collapsed|}}}|no|expanded|collapsed}}" style="{{#switch:{{{align|}}}{{{float|}}}
+
{| class="collapsible {{#ifeq:{{yesno-no|{{{collapsed|{{{collapse|}}}}}}}}|yes|collapsed|expanded}}" style="{{#switch:{{{align|}}}{{{float|}}}
 
  | left = margin: 0.3em 0 0.3em 1em; float:left; clear:{{{clear|left}}}; min-width:{{{min-width|{{{width|33em}}}}}};
 
  | left = margin: 0.3em 0 0.3em 1em; float:left; clear:{{{clear|left}}}; min-width:{{{min-width|{{{width|33em}}}}}};
 
  | right = margin: 0.3em 1em 0.3em 1em; float:right; clear:{{{clear|right}}}; min-width:{{{min-width|{{{width|33em}}}}}};
 
  | right = margin: 0.3em 1em 0.3em 1em; float:right; clear:{{{clear|right}}}; min-width:{{{min-width|{{{width|33em}}}}}};
 
  | #default = margin: 0.3em auto auto; clear:{{{clear|none}}}; min-width:{{{min-width|{{{width|60em}}}}}};
 
  | #default = margin: 0.3em auto auto; clear:{{{clear|none}}}; min-width:{{{min-width|{{{width|60em}}}}}};
 
  }} width:{{{width|auto}}}; font-size:88%; border:1px solid #aaa;"
 
  }} width:{{{width|auto}}}; font-size:88%; border:1px solid #aaa;"
! style="padding:0.2em 0.3em 0.2em 4.3em;background:none; width:{{{width|auto}}}" | {{{1|Family of {{PAGENAME}}}}}
+
! style="padding:0.2em 0.3em 0.2em {{#if:{{{template_name|}}}|0.3em|4.3em}};background:none; width:{{{width|auto}}}" | {{#if:{{{template_name|}}}
 +
|{{Navbar-collapsible|{{{1|Family of {{PAGENAME}}}}}|{{{template_name}}}}}
 +
|{{{1|Family of {{PAGENAME}}}}}
 +
}}
 
|-
 
|-
 
| style="text-align:{{{text-align|center}}}" | <noinclude>
 
| style="text-align:{{{text-align|center}}}" | <noinclude>
 
|}
 
|}
 
{{documentation}}</noinclude>
 
{{documentation}}</noinclude>

Latest revision as of 13:00, 30 July 2020

Family of Chart top
50px Template documentation[view] [edit] [history] [purge]

This was created to allow for the width of ancestry boxes to adapt if there is a tall thumbnail to the right. Put it and {{Chart bottom}} on separate lines from the Chart template they wrap around.

{{Chart top}}
by default, shows Family of X where X is the name of the article
{{Chart top|title}}
to change the title of the table
{{Chart top|width=100%}}
to change the width of the table
{{Chart top|clear=right}}
to push the table below any prior right floating elements
{{Chart top|clear=left}}
to push the table below any prior left floating elements
{{Chart top|clear=both}}
to push the table below any prior left or right floating elements (note: width=100% typically will (in most cases) force the table to use the full page width, and push the table below floating elements)

This template will show a collapsed (fully-closed) version of the enclosed Chart when first seen on the page, with a "(show)" option for the reader. To show the reader on first sight an uncollapsed Chart, with a title bar with a "(hide)" option, add |collapsed=no.

See also