Difference between revisions of "Template:Detect singular"

From blackwiki
Jump to navigation Jump to search
imported>Mifter
m (Protected "Template:Detect singular": Highly visible template ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite)))
imported>Mifter
(Adding {{pp-template}} (TW))
Line 1: Line 1:
−
{{#ifexpr:({{#invoke:String|find|{{{1|}}}|,}}+{{#invoke:String|find|{{{1|}}}|list}}+{{#invoke:String|find|{{{1|}}}|<%s*br|plain=false}})>0||1}}<noinclude>{{documentation}}</noinclude>
+
<noinclude>{{pp-template|small=yes}}</noinclude>{{#ifexpr:({{#invoke:String|find|{{{1|}}}|,}}+{{#invoke:String|find|{{{1|}}}|list}}+{{#invoke:String|find|{{{1|}}}|<%s*br|plain=false}})>0||1}}<noinclude>{{documentation}}</noinclude>

Revision as of 07:03, 7 December 2018

1

Template documentation[view] [edit] [history] [purge]

Usage

Used to detect possible lists. Useful for infoboxes, where the label may be singular (e.g., "Nickname:") but the data may be a list. One required parameter (the string to search for a list). Returns 1 if not a list, nil if a possible list.

Examples:

{{Detect singular|Mack the Knife}} → 1

{{Detect singular|Mack the Knife, Joe}} →

{{Detect singular|{{hlist|first|second|third}}}} →

It is not foolproof, however:

{{Detect singular|[[Charles, Prince of Wales]]}} →

{{Detect singular|[[Dave Nellist]]}} →