Difference between revisions of "Module:Wd/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>Thayts
m (20 revisions imported)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Module rating|protected}}
 +
{{High-use}}
 
{{ombox|text=You might want to use one of the user-friendly wrapper templates {{t|Wikidata}} and {{t|WikidataOI}} instead of invoking this module directly.}}
 
{{ombox|text=You might want to use one of the user-friendly wrapper templates {{t|Wikidata}} and {{t|WikidataOI}} instead of invoking this module directly.}}
{{High-use|162750}}
 
 
{{Lua sidebar|template=Wikidata|module=Wd}}
 
{{Lua sidebar|template=Wikidata|module=Wd}}
 
{{Wd/doc|prename=<nowiki/>#invoke:|prename_code=#invoke:|section==== Main class ===
 
{{Wd/doc|prename=<nowiki/>#invoke:|prename_code=#invoke:|section==== Main class ===
If used, the main command must always come first, followed by at least one other command. It does not take any flags.
+
The <code>main</code> command is always used alone and does not take any flags or arguments. It allows parent templates to pass on their parameters in the form of commands to this module.
 
<table class="wikitable">
 
<table class="wikitable">
 
<tr>
 
<tr>
Line 12: Line 13:
 
<tr>
 
<tr>
 
<th style="text-align:left;"><code>main</code></th>
 
<th style="text-align:left;"><code>main</code></th>
<td>{{tnull|<nowiki/>#invoke:{{lc:{{ROOTPAGENAME}}}}|main|command|P1}}</td>
+
<td>{{nowrap|{{tnull|<nowiki/>#invoke:{{lc:{{ROOTPAGENAME}}}}|main}}}}</td>
 
<td>Intended for use by wrapper templates (around this module) to invoke one or more of the above commands, returning their respective output.
 
<td>Intended for use by wrapper templates (around this module) to invoke one or more of the above commands, returning their respective output.
<p>The parameters passed to the wrapper template are the ones that will be used by the module, e.g. {{tnull|wikidata|'''property'''|'''P1549'''}} → {{tnull|<nowiki/>#invoke:Wd|main}} → {{tnull|<nowiki/>#invoke:Wd|main|'''property'''|'''P1549'''}}.</p>
+
<p>The parameters passed to the wrapper template are the ones that will be used by the module, e.g. {{tnull|wikidata|'''property'''|'''P1549'''}} → {{tnull|<nowiki/>#invoke:wd|main}} → {{tnull|<nowiki/>#invoke:wd|main|'''property'''|'''P1549'''}}.</p>
<p>Therefore, any parameters set by the wrapper template itself will be discarded, e.g. {{tnull|wikidata|'''property'''|'''P1549'''}} → {{tnull|<nowiki/>#invoke:Wd|main|{{color|red|qualifier}}|{{color|red|P1082}}|{{color|red|P585}}}} → {{tnull|<nowiki/>#invoke:Wd|main|'''property'''|'''P1549'''}}.</p>
+
<p>Therefore, any parameters set by the wrapper template itself will be discarded, e.g. {{tnull|wikidata|'''property'''|'''P1549'''}} → {{tnull|<nowiki/>#invoke:wd|main|{{color|red|qualifier}}|{{color|red|P1082}}|{{color|red|P585}}}} → {{tnull|<nowiki/>#invoke:wd|main|'''property'''|'''P1549'''}}.</p>
 
</td>
 
</td>
 
</tr>
 
</tr>
 
</table>}}
 
</table>}}

Latest revision as of 12:21, 26 September 2020

Template:Wd/doc