Jump to content
Wikipedia The Free Encyclopedia

Module:GetShortDescription/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Fred Gandt (talk | contribs) at 19:27, 24 January 2023 (add Category:Modules using data from Wikidata and remove {{Uses wikidata}} due to awkwardness). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision .Revision as of 19:27, 24 January 2023 by Fred Gandt (talk | contribs) (add Category:Modules using data from Wikidata and remove {{Uses wikidata}} due to awkwardness)
icon This is a documentation subpage for Module:GetShortDescription.
It may contain usage information, categories and other content that is not part of the original module page.
This module is rated as alpha. It is ready for limited use and third-party feedback. It may be used on a small number of pages, but should be monitored closely. Suggestions for new features or adjustments to input and output are welcome.
This module depends on the following other modules:

Usage

{{#invoke:GetShortDescription|main |name= |only= |prefer= |fallback= |lang_italic= |lang_nocat= |lang_size= |lang_cat= |lang_rtl= |lang_no= }}

Name

By providing only the required page name (including namespace), the module will look for an explicit {{short description}} in that page, but if not found, will try to fetch the wikidata description. If neither are found, the result will be an empty string.

If the result is a wikidata description, and it is declared (at the source) as being non-English (en), the result will be wrapped in {{lang}} by default; see #Non-English wikidata descriptions (below).

This is equivalent to stating |prefer=explicit; see #Prefer (below).

Code: {{#invoke:GetShortDescription|main |name=Example }}

Result: table

Only

Stating |only= will limit the search to being only for the stated description. If no description is found, the result will be an empty string, unless a fallback is provided; see #Fallback (below).

Explicit or nothing

Code: {{#invoke:GetShortDescription|main |name=Example |only=explicit }}

Result:

Wikidata or nothing

Code: {{#invoke:GetShortDescription|main |name=Example |only=wikidata }}

Result: table

Prefer

Stating |prefer= will initiate the search for the stated description, but try for the alternative if none is found. If no description is found, the result will be an empty string, unless a fallback is provided; see #Fallback (below).

Explicit or wikidata or nothing

Code: {{#invoke:GetShortDescription|main |name=Example |prefer=explicit }}

Result: table

Wikidata or explicit or nothing

Code: {{#invoke:GetShortDescription|main |name=Example |prefer=wikidata }}

Result: table

Fallback

If a |fallback= is provided, and no description is found by the expressed route, the result will be the stated fallback.

Only or fallback

Code: {{#invoke:GetShortDescription|main |name=Example |only=explicit |fallback=This is a fallback }}

Result:

Prefer or fallback

Code: {{#invoke:GetShortDescription|main |name=Example |prefer=wikidata |fallback=This is a fallback }}

Result: table

Non-English wikidata descriptions

Should a wikidata description be retrieved, which is declared (at the source) as being non-English (en), the return will be wrapped in {{lang}} by default; this may be disabled with |lang_no=yes.

The parameters for {{lang}} may be provided via: |lang_italic=, |lang_nocat=, |lang_size=, |lang_cat= and |lang_rtl=; see lang's documentation for details.


AltStyle によって変換されたページ (->オリジナル) /