Template:CTD article: Difference between revisions

m
Add 'works' parameter (parity with ru 'труды'): marks author as having works in the Library and links to the Category:<Short name> (works)
(Support the mentioned in field for reviewed CTD entries)
m (Add 'works' parameter (parity with ru 'труды'): marks author as having works in the Library and links to the Category:<Short name> (works))
 
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:
| <pre>
| <pre>
{{CTD article
{{CTD article
  | term =  
  | term =
  | term to show =  
  | term to show =
  | person =  
  | person =
  | short name =  
| works =
  | short name =
  | initials =  
  | initials =  
  | origin =
  | origin =
Line 46: Line 47:
* '''term to show''' -- the same term with diacritical marks (if exist) and stress mark (if needed); if term is a name then put it in a full form in regular order, for example: ''Helena Petrovna Blavatsky''; {{p|CTD term to show}}, {{p|CTD term}}
* '''term to show''' -- the same term with diacritical marks (if exist) and stress mark (if needed); if term is a name then put it in a full form in regular order, for example: ''Helena Petrovna Blavatsky''; {{p|CTD term to show}}, {{p|CTD term}}
* '''person''' -- "yes" if it is a person, in this case term will be added to category {{c|Persons}} and semantic properties {{p|Name}}, {{p|Full name}}, {{p|Short name}} and {{p|Short name regular}} are set; ''full name'' is a name set in ''term to show'' parameter or equals ''term'' otherwise
* '''person''' -- "yes" if it is a person, in this case term will be added to category {{c|Persons}} and semantic properties {{p|Name}}, {{p|Full name}}, {{p|Short name}} and {{p|Short name regular}} are set; ''full name'' is a name set in ''term to show'' parameter or equals ''term'' otherwise
* '''works''' -- "yes" if this author has works in the Library; in this case the article is placed in category {{c|Authors}} and a link to the category with this author's works is added (f.e. {{c|Blavatsky H.P. (works)}})
* '''short name''' -- short version of name or family name (surname) for bibliography, i.e. ''Blavatsky'' or ''Avicenna''; {{p|Short name}}
* '''short name''' -- short version of name or family name (surname) for bibliography, i.e. ''Blavatsky'' or ''Avicenna''; {{p|Short name}}
* '''initials''' -- initials to add to surname for bibliography and short references; if set, then '''short name''' is interpreted as surname and two properties are set:
* '''initials''' -- initials to add to surname for bibliography and short references; if set, then '''short name''' is interpreted as surname and three properties are set:
: • {{p|Short name regular}} in regular format '''N. M. Surname''', f.e.: ''H. P. Blavatsky'', or ''Rev. W. B. Slaughter'', or ''J.-E. de Mirville''
: • {{p|Short name regular}} in regular format '''N. M. Surname''', f.e.: ''H. P. Blavatsky'', or ''Rev. W. B. Slaughter'', or ''J.-E. de Mirville''
: • {{p|Short name}} in sortable format '''Surname, N. M.''', f.e.: ''Blavatsky, H. P.'', or ''Slaughter, Rev. W. B.'', or ''Mirville, J.-E. de''
: • {{p|Short name}} in sortable format '''Surname, N. M.''', f.e.: ''Blavatsky, H. P.'', or ''Slaughter, Rev. W. B.'', or ''Mirville, J.-E. de''
: • {{p|Short name for categories}} in compact format '''Surname N.M.''' (no comma, no spaces between initials), f.e.: ''Blavatsky H.P.''; used to build author category names, f.e. {{c|Blavatsky H.P. (works)}}


* '''origin''' -- spelling in original language, original meaning, etymology; {{p|CTD term origin}}
* '''origin''' -- spelling in original language, original meaning, etymology; {{p|CTD term origin}}
Line 103: Line 106:
   set short name according to initials value
   set short name according to initials value
-->{{#if: {{{initials|}}}
-->{{#if: {{{initials|}}}
  | {{#vardefine:short name|{{{short name|}}}, {{{initials|}}}}} {{#vardefine:short name regular|{{{initials|}}} {{{short name|}}}}}
  | {{#vardefine:short name|{{{short name|}}}, {{{initials|}}}}} {{#vardefine:short name regular|{{{initials|}}} {{{short name|}}}}} {{#vardefine:short name for categories|{{{short name|}}} {{#invoke:CTD|nospaces|{{{initials|}}}}}}}
  | {{#vardefine:short name|{{{short name|}}}}}
  | {{#vardefine:short name|{{{short name|}}}}} {{#vardefine:short name for categories|{{{short name|}}}}}
}}<!--  
}}<!--  


Line 142: Line 145:
-->{{#vardefine:person|{{lc: {{{person|}}} }}}}<!-- turn letters to lower case
-->{{#vardefine:person|{{lc: {{{person|}}} }}}}<!-- turn letters to lower case
-->{{#switch: {{#var:person}}
-->{{#switch: {{#var:person}}
  | yes = {{#set: Name={{{term|}}} | Short name={{#var:short name}} | Short name regular={{#var:short name regular}} }} {{#if: {{{term to show|}}}| {{#set: Full name={{{term to show|}}}}} | {{#set: Full name={{{term|}}}}} }}[[Category: Persons]]
  | yes = {{#set: Name={{{term|}}} | Short name={{#var:short name}} | Short name regular={{#var:short name regular}} | Short name for categories={{#var:short name for categories}} }} {{#if: {{{term to show|}}}| {{#set: Full name={{{term to show|}}}}} | {{#set: Full name={{{term|}}}}} }}[[Category: Persons]]
  | default = [[Category: CTD terms]]
  | default = [[Category: CTD terms]]
}}<!--  
}}<!--  
Line 177: Line 180:
{{#if: {{{mentioned in|}}}
{{#if: {{{mentioned in|}}}
|{{#set: CTD mentioned in={{{mentioned in|}}}|+sep=;}}
|{{#set: CTD mentioned in={{{mentioned in|}}}|+sep=;}}
<p style="font-weight: bold; text-indent: 0; margin-top: 1em;">Mentioned in:</p>
<ul>{{#arraymap:{{{mentioned in|}}}|;|@@|<li>@@</li>|}}</ul>
|}}
|}}


Line 187: Line 188:
   Links to other pages and resources;
   Links to other pages and resources;
   see if there are any:
   see if there are any:
-->{{#ifeq: {{lc:{{{works|}}}}} | yes | {{#vardefine:link_exists|yes}} |}}<!--
-->{{#if: {{{library pages|}}}  | {{#vardefine:link_exists|yes}} |}}<!--
-->{{#if: {{{library pages|}}}  | {{#vardefine:link_exists|yes}} |}}<!--
-->{{#if: {{{library links|}}}  | {{#vardefine:link_exists|yes}} |}}<!--
-->{{#if: {{{library links|}}}  | {{#vardefine:link_exists|yes}} |}}<!--
Line 198: Line 200:
-->{{#varexists:link_exists|{{Style P-No indent|'''Some links:'''}}
-->{{#varexists:link_exists|{{Style P-No indent|'''Some links:'''}}
<ul>
<ul>
{{#if: {{{library links|}}}|<li>Related pages: {{#arraymap:{{{library links|}}}|;|@@|@@}}</li>|}}<!--
{{#ifeq: {{lc:{{{works|}}}}} | yes |<li>Works: [[:Category:{{#if:{{{short name|}}}|{{#var:short name for categories}}|{{{term|}}}}} (works)|{{#if:{{{short name|}}}|{{#var:short name for categories}}|{{{term|}}}}} (works)]]</li>[[Category: Authors]]|}}<!--
-->{{#if: {{{library links|}}}|<li>Related pages: {{#arraymap:{{{library links|}}}|;|@@|@@}}</li>|}}<!--
-->{{#if: {{{library pages|}}}|<li>Related pages: {{#arraymap:{{{library pages|}}}|;|@@|[[@@]]}}</li>|}}<!--
-->{{#if: {{{library pages|}}}|<li>Related pages: {{#arraymap:{{{library pages|}}}|;|@@|[[@@]]}}</li>|}}<!--
-->{{#if: {{{quotes|}}}|<li>Quotes: {{#arraymap:{{{quotes|}}}|;|@@|[[Quotes:{{FULLPAGENAME}}#@@|@@]]}}</li>|}}<!--
-->{{#if: {{{quotes|}}}|<li>Quotes: {{#arraymap:{{{quotes|}}}|;|@@|[[Quotes:{{FULLPAGENAME}}#@@|@@]]}}</li>|}}<!--
Line 206: Line 209:
-->{{#if: {{{other resources|}}}|<li>Other resources: {{#arraymap:{{{other resources|}}}|;|@@|@@}}</li>|}}
-->{{#if: {{{other resources|}}}|<li>Other resources: {{#arraymap:{{{other resources|}}}|;|@@|@@}}</li>|}}
</ul>|}}
</ul>|}}
<!--
  MENTIONS: collapsible block, collapsed by default; shown only if filled.
  Placed before the DATA block.
-->{{#if: {{{mentioned in|}}}
| <table class="mw-collapsible mw-collapsed" style="background:#f8f9fa;border:1px solid grey;width:100%;margin-top:1em;">
<tr><td style="font-weight:bold;padding:3px 5px;">Mentions</td></tr>
<tr><td style="padding:0 8px 8px 8px;">
<p style="font-weight: bold; text-indent: 0; margin-top: 1em;">Mentioned in:</p>
<ul>{{#arraymap:{{{mentioned in|}}}|;|@@|<li>@@</li>|}}</ul>
</td></tr>
</table>
}}


<!-- Some important data for semantic requests -->
<!-- Some important data for semantic requests -->
Line 212: Line 227:
<p style="text-indent: 0px;">To show: <b>{{#var:term to show}}</b>; sortable: <b>{{{term|}}}</b><br>
<p style="text-indent: 0px;">To show: <b>{{#var:term to show}}</b>; sortable: <b>{{{term|}}}</b><br>
{{#switch: {{#var:person}}
{{#switch: {{#var:person}}
  | yes =Person's short name: <b>{{#var:short name regular}}</b>; sortable: <b>{{#var:short name}}</b><br>
  | yes =Person's short name: <b>{{#var:short name regular}}</b>; sortable: <b>{{#var:short name}}</b>; for categories: <b>{{#var:short name for categories}}</b><br>
  |}}
  |}}
Lifetime: <b>{{#var:lifetime}}</b><br>
Lifetime: <b>{{#var:lifetime}}</b><br>