Difference between revisions of "Template:PrintTermPluralCapitalized"
Jump to navigation
Jump to search
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
− | This template is used to print a plural capitalized | + | This template is used to print a plural capitalized form of each term in the string. If the respective page doesn't exist, the basic <code><nowiki>{{ucfirst: {{Plural|</nowiki>''term''<nowiki>}}}}</nowiki></code> is used for each term in the string. |
'''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page. | '''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page. | ||
'''Parameters:''' | '''Parameters:''' | ||
− | * <code>''string''</code> - the term. | + | * <code>''string''</code> - the term or terms (comma separated). |
− | * <code>''link''</code> - if given, links will be printed. | + | * <code>''link''</code> - if given, links will be printed. Ignored if there is no such page in the encyclopedia. |
</noinclude><includeonly><!-- | </noinclude><includeonly><!-- | ||
Line 12: | Line 12: | ||
-->|<!-- | -->|<!-- | ||
--><!-- convert to an array in case there are multiple values | --><!-- convert to an array in case there are multiple values | ||
− | -->{{#arraydefine: arrayTerms|{{{1|}}}|,}}<!-- | + | -->{{#arraydefine: arrayTerms|{{{1|}}}|,|unique}}<!-- |
-->{{#arrayprint: arrayTerms||varTerm<!-- | -->{{#arrayprint: arrayTerms||varTerm<!-- | ||
-->|<!-- | -->|<!-- | ||
--><!-- check if the page exists | --><!-- check if the page exists | ||
− | -->{{#if: {{IfObjectExists|object={{# | + | -->{{#if: {{IfObjectExists|object=varTerm|}}<!-- |
− | + | -->|<!-- | |
− | -->| | + | -->{{#if: {{{2|}}}<!-- |
+ | -->|[[varTerm|{{#show: varTerm|?Plural Capitalized|link=none}}]]<!-- | ||
+ | -->|{{#show: varTerm|?Plural Capitalized|link=none}}<!-- | ||
+ | -->}}<!-- if link | ||
+ | --><!-- | ||
+ | -->|{{ucfirst: {{Plural|varTerm}}}}<!-- | ||
-->}}<!-- if exists | -->}}<!-- if exists | ||
--><!-- | --><!-- | ||
-->|print=pretty<!-- | -->|print=pretty<!-- | ||
-->}}<!-- arrayprint | -->}}<!-- arrayprint | ||
− | |||
− | |||
− | |||
− | |||
--><!-- | --><!-- | ||
-->|<!-- nothing to return | -->|<!-- nothing to return | ||
-->}}<!-- if | -->}}<!-- if | ||
--></includeonly> | --></includeonly> |
Latest revision as of 15:43, 10 January 2023
This template is used to print a plural capitalized form of each term in the string. If the respective page doesn't exist, the basic {{ucfirst: {{Plural|term}}}}
is used for each term in the string.
NOTE: As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.
Parameters:
string
- the term or terms (comma separated).link
- if given, links will be printed. Ignored if there is no such page in the encyclopedia.