Difference between revisions of "Module:Wd/doc"
Jump to navigation
Jump to search
blackwiki>Pppery (Moved ombox from Template:Wd/doc) |
blackwiki>Pppery (Copying in code for main class from Module:Wd/doc, with some changes to fix problems I introduced via overzealous Template:Tnull conversions) |
||
| Line 1: | Line 1: | ||
{{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.}} | ||
| − | {{Wd/doc|prename=#invoke:}} | + | {{Wd/doc|prename=<nowiki/>#invoke:|section==== Main class === |
| + | <table class="wikitable"> | ||
| + | <tr> | ||
| + | <th>Command</th> | ||
| + | <th>Basic usage</th> | ||
| + | <th>Description</th> | ||
| + | </tr> | ||
| + | <tr> | ||
| + | <th style="text-align:left;"><code>main</code></th> | ||
| + | <td><code><nowiki>{{#invoke:</nowiki>{{lc:{{ROOTPAGENAME}}}}<nowiki>|main|command|P1}}</nowiki></code></td> | ||
| + | <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. <code><nowiki>{{wikidata|</nowiki>'''property'''<nowiki>|</nowiki>'''P1549'''<nowiki>}}</nowiki></code> → <code><nowiki>{{#invoke:Wd|main}}</nowiki></code> → <code><nowiki>{{#invoke:Wd|main|</nowiki>'''property'''<nowiki>|</nowiki>'''P1549''''<nowiki>}}</nowiki></code>.</p> | ||
| + | <p>Therefore, any parameters set by the wrapper template itself will be discarded, e.g. <code><nowiki>{{wikidata|</nowiki>'''property'''<nowiki>|</nowiki>'''P1549'''}} → <code><nowiki>{{#invoke:Wd|main|</nowiki>{{color|red|qualifier}}<nowiki>|</nowiki>{{color|red|P1082}}<nowiki>|</nowiki>{{color|red|P585}}'<nowiki>}}</nowiki></code> → <code><nowiki>{{#invoke:Wd|main|</nowiki>'''property'''<nowiki>|</nowiki>'''P1549''''<nowiki>}}</nowiki></code>.</p> | ||
| + | </td> | ||
| + | </tr> | ||
| + | </table>}} | ||
Revision as of 19:13, 12 October 2017
| 40x40px | You might want to use one of the user-friendly wrapper templates Template:T and Template:T instead of invoking this module directly. |
Template:Wd/doc → {{#invoke:Wd|main|qualifier|P1082|P585'}} → {{#invoke:Wd|main|property|P1549'}}.
}}