Module:WikidataIB/doc: Difference between revisions

Content deleted Content added
Parameters to getValue: list: added more examples.
Formatting multiple returned values: Added descriptions of list=prose, list=cslist, list=blist, list=olist.
Line 365:
* {{para|sorted|<yes{{!}}no>}} is a boolean passed to enable sorting of the values returned. No parameter, or an empty string, or "false", or "no", or "0" disables sorting. It's only a very dumb alphabetical sort and sorts linked values as "[[ ..."
* {{para|sep|<separator characters>}} allows the separator between multiple returned values to be defined. The default is <code>", "</code> (comma plus normal space). If the separator has leading or trailing spaces, enclose it in double quotes (e.g. {{para|sep|" - "}}). Any double quotes are stripped from the separator. The pipe character (<code>|</code>) must be escaped as <code><nowiki>{{!}}</nowiki></code>. For reasons of accessibility (see [[MOS:PLIST]]), do not use {{para|sep|&lt;br>}} for vertical unbulleted lists; use {{para|list|ubl}} instead.
* {{para|list|<prose{{!}}cslist{{!}}hlist{{!}}ubl{{!}}blist{{!}}olist>}} allows multiple returned values to be displayed as a sentence with last two values separated by "and" ({{para|list|prose}}), a horizontal comma-separated list ({{para|list|hlistcslist}}, not to be used in prose), ora horizontal list ({{para|list|hlist}}), a vertical unbulleted list ({{para|list|ubl}}), a vertical bulleted list ({{para|list|blist}}), or a vertical ordered list ({{para|list|olist}}). These override the separator and do not display the 'pen icon' linked to "Edit at Wikidata".
* {{para|list|p-1}} displays the last value. Combine with {{para|maxvals|''n''}} to display the ''n''th value.