Template:Authority control: Difference between revisions

PS (talk | contribs)
No edit summary
PS (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<div class="authority-control noprint" style="font-size:90%;">
<!-- Template:Authority control
==Authority control==
    Improved, accessible, and collapsible authority control box for biography pages.
{{#if:{{{VIAF|}}}|* [[VIAF (identifier)|VIAF]]: [https://viaf.org/viaf/{{{VIAF}}} {{{VIAF}}}]}}
    Usage example (put at bottom of an article):
{{#if:{{{ISNI|}}}|* [[ISNI]]: [https://isni.org/isni/{{{ISNI}}} {{{ISNI}}}]}}
 
{{#if:{{{LCCN|}}}|* [[Library of Congress Control Number|LCCN]]: [https://lccn.loc.gov/{{{LCCN}}} {{{LCCN}}}]}}
    {{Authority control
{{#if:{{{GND|}}}|* [[GND (identifier)|GND]]: [https://d-nb.info/gnd/{{{GND}}} {{{GND}}}]}}
      | VIAF    = 123456789
{{#if:{{{SUDOC|}}}|* [[SUDOC (identifier)|SUDOC]]: [https://www.idref.fr/{{{SUDOC}}} {{{SUDOC}}}]}}
      | ISNI    = 0000000121032683
{{#if:{{{WorldCat|}}}|* [[WorldCat Identities|WorldCat]]: [https://worldcat.org/identities/{{{WorldCat}}} {{{WorldCat}}}]}}
      | LCCN    = n79021164
      | GND      = 118540238
      | SUDOC    = 026718726
      | WorldCat = lccn-n79021164
      | Wikidata = Q42
    }}
 
    Design goals:
    - Only show filled fields
    - Collapse by default (configurable)
    - Accessible (ARIA)
    - Clean markup so skins can restyle easily
-->
 
<div class="mw-collapsible mw-collapsed authority-control noprint" role="region" aria-label="Authority control" style="font-size:90%; border:1px solid #ccc; padding:0.5em; margin-top:1em;">
  <div style="font-weight:bold; margin-bottom:0.25em;">Authority control</div>
  <ul style="margin:0; padding-left:20px;">
    {{#if:{{{VIAF|}}}|<li>[[VIAF (identifier)|VIAF]]: [https://viaf.org/viaf/{{{VIAF}}} {{{VIAF}}}]</li>}}
    {{#if:{{{ISNI|}}}|<li>ISNI: [https://isni.org/isni/{{{ISNI}}} {{{ISNI}}}]</li>}}
    {{#if:{{{LCCN|}}}|<li>[[Library of Congress Control Number|LCCN]]: [https://lccn.loc.gov/{{{LCCN}}} {{{LCCN}}}]</li>}}
    {{#if:{{{GND|}}}|<li>[[GND (identifier)|GND]]: [https://d-nb.info/gnd/{{{GND}}} {{{GND}}}]</li>}}
    {{#if:{{{SUDOC|}}}|<li>SUDOC: [https://www.idref.fr/{{{SUDOC}}} {{{SUDOC}}}]</li>}}
    {{#if:{{{WorldCat|}}}|<li>[[WorldCat Identities|WorldCat]]: [https://worldcat.org/identities/{{{WorldCat}}} {{{WorldCat}}}]</li>}}
    {{#if:{{{Wikidata|}}}|<li>[[Wikidata]]: [https://www.wikidata.org/wiki/{{{Wikidata}}} {{{Wikidata}}}]</li>}}
    <!-- Add any additional identifier parameters here following the same pattern -->
  </ul>
</div>
</div>
<noinclude>
<noinclude>
==Usage==
==Usage==
To add authority control data to an article, use:
Add at the bottom of a biography or notable subject page (only filled fields are shown):


<pre>
<pre>
{{Authority control
{{Authority control
  | VIAF =  
  | VIAF     = 123456789
  | ISNI =  
  | ISNI     = 0000000121032683
  | LCCN =  
  | LCCN     = n79021164
  | GND =  
  | GND     = 118540238
  | SUDOC =  
  | SUDOC   = 026718726
  | WorldCat =  
  | WorldCat = lccn-n79021164
| Wikidata = Q42
}}
}}
</pre>
</pre>


Only fill in the fields you have data for. Empty fields will not be shown.
==Notes & customization==
* The box is collapsed by default using <code>mw-collapsible mw-collapsed</code>. To make it expanded by default, remove <code>mw-collapsed</code>.
* The template uses inline styling for backwards compatibility. If you prefer site-wide styles, move styles into MediaWiki:Common.css or a TemplateStyles module and remove the inline <code>style</code> attribute.
* To add more identifiers, copy one of the <code>{{#if:...}}</code> lines and replace the parameter name and URL template.
 
==Recommended site CSS (optional)==
If you manage the wiki skin or MediaWiki:Common.css, you can replace inline styles with something like:
 
<pre>
/* Authority control box styling */
.authority-control { font-size:90%; border:1px solid #ccc; padding:0.5em; margin-top:1em; }
.authority-control > div:first-child { font-weight:bold; margin-bottom:0.25em; }
.authority-control ul { margin:0; padding-left:20px; }
</pre>
 
==Template history & contributors==
This improved version was created to provide clearer, more accessible markup and easier customization.
</noinclude>
</noinclude>