Jump to content

Template:Authority control: Difference between revisions

From Wikigama
PS (talk | contribs)
No edit summary
PS (talk | contribs)
No edit summary
 
Line 1: Line 1:
<div class="mw-collapsible mw-collapsed authority-control noprint" style="font-size:90%; border: 1px solid #ccc; padding: 5px; margin-top: 1em;">
<!-- Template:Authority control
<div style="font-weight: bold;">Authority control</div>
    Improved, accessible, and collapsible authority control box for biography pages.
<ul style="margin: 0; padding-left: 20px;">
    Usage example (put at bottom of an article):
{{#if:{{{VIAF|}}}|<li>[[VIAF (identifier)|VIAF]]: [https://viaf.org/viaf/{{{VIAF}}} {{{VIAF}}}]</li>}}
 
{{#if:{{{ISNI|}}}|<li>[[ISNI]]: [https://isni.org/isni/{{{ISNI}}} {{{ISNI}}}]</li>}}
    {{Authority control
{{#if:{{{LCCN|}}}|<li>[[Library of Congress Control Number|LCCN]]: [https://lccn.loc.gov/{{{LCCN}}} {{{LCCN}}}]</li>}}
      | VIAF    = 123456789
{{#if:{{{GND|}}}|<li>[[GND (identifier)|GND]]: [https://d-nb.info/gnd/{{{GND}}} {{{GND}}}]</li>}}
      | ISNI    = 0000000121032683
{{#if:{{{SUDOC|}}}|<li>[[SUDOC (identifier)|SUDOC]]: [https://www.idref.fr/{{{SUDOC}}} {{{SUDOC}}}]</li>}}
      | LCCN    = n79021164
{{#if:{{{WorldCat|}}}|<li>[[WorldCat Identities|WorldCat]]: [https://worldcat.org/identities/{{{WorldCat}}} {{{WorldCat}}}]</li>}}
      | GND      = 118540238
{{#if:{{{Wikidata|}}}|<li>[[Wikidata]]: [https://www.wikidata.org/wiki/{{{Wikidata}}} {{{Wikidata}}}]</li>}}
      | SUDOC    = 026718726
</ul>
      | 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==
Add at the bottom of a biography or notable subject page:
Add at the bottom of a biography or notable subject page (only filled fields are shown):


<pre>
<pre>
Line 28: Line 50:
</pre>
</pre>


Only filled fields are shown. The box will be collapsed by default.
==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>

Latest revision as of 18:12, 10 August 2025


Authority control


Usage

Add at the bottom of a biography or notable subject page (only filled fields are shown):

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

Notes & customization

  • The box is collapsed by default using mw-collapsible mw-collapsed. To make it expanded by default, remove mw-collapsed.
  • 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 style attribute.
  • To add more identifiers, copy one of the lines and replace the parameter name and URL template.

If you manage the wiki skin or MediaWiki:Common.css, you can replace inline styles with something like:

/* 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; }

Template history & contributors

This improved version was created to provide clearer, more accessible markup and easier customization.