Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:External links/conf/documentation page
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Module "{{PAGENAME}}" contains configuration used by [[Module:External links]] There are a number of rows in the variable ''configured_claims'' that describe which Wikidata properties should be used to create external links in articles. These rows are structured as follows: <syntaxhighlight lang="lua" inline>{ prop='Pnnnn', message="$3 [$2 ''$1''] <description>", short="[$2 <text>]", langcode='aa', url="...", url_f=<function>, regex="...", genitive=<boolean>, track=<boolean> },</syntaxhighlight> Where the following is the case: * <samp>prop</samp> β The property name to process. ** <code>Pnnnn</code> β If this is a "P" followed by a number (<samp>Pnnnn</samp>), it is assumed that this is a Property number on Wikidata to be checked. Eg. P345 which is then the number for IMDB links. If this exists for the article, an external link for this property will potentially appear. ** <code>SLaaaa</code> β If it consists of "SL" followed by an interwiki name, e.g. <code>SLspecieswiki</code>, it will attempt to retrieve the name of the corresponding article on the second wiki, with spaces underlined. ** If there is another property name, this is treated as a purely local definition and needs to get the value / identifier from the name of the module. See example below. * <samp>message</samp> β The text to be displayed in the article. It has two special values: <samp>$1</samp> and <samp>$2</samp>. These two will be replaced with the following: ** <samp>$1</samp> β Replaced with the article name. See also <samp>genitive</samp> below. ** <samp>$2</samp> β Replaced with the raw URL of the external link. Eg. <samp>http://www.imdb.com/title/tt0085255/</samp> ** <samp>$3</samp> β Replaced with a language code. Eg. {{in lang|no}} for Norwegian language (<samp>no</samp>). See <code>langcode</code>. ** <samp>$4</samp> β Replaced by the value itself. ** <samp>$5</samp> β Replaced by a URI formatted version of the value itself. * <samp>short</samp> β A short version of the text to be displayed. It has two special values: <samp>$1</samp> and <samp>$2</samp>. These two will be replaced similarly to the <code>message</code> above. * <samp>langcode</samp> β Enter the language code for the site. This is used to make an indication of the language of the site. If a P-value is entered here, the module will look for this P-value as a qualifier under P305 (the language of the work). Currently only <code>P407</code> is supported here. * <samp>url_f</samp> β Here you can enter a formatting function for the URLs to be called. This is only the name of the function (which must be defined locally '''above''' ''configured_claims'' in this module. The function will be called with one variable which is the identifier that comes from Wikidata or locally and a completed raw URL is expected back. Example: <syntaxhighlight lang="lua" inline>url_f=imdb_formatter</syntaxhighlight>. This feature is the first priority when choosing between multiple options. * <samp>url</samp> β Here you can enter the URL to be called. Example: <syntaxhighlight lang="lua" inline>url="http://www.imdb.com/tt/$1"</syntaxhighlight>. This string is second priority when choosing between multiple options. This one has a special value: <samp>$1</samp> which will be replaced with the following: ** <samp>$1</samp> β Replaced with the identifier that comes from Wikidata or locally. * <samp>regex</samp> β Here you can enter a regexp string that will be used to verify that the identifier that comes from Wikidata or locally has the correct format. Example: <syntaxhighlight lang="lua" inline>regex="tt\\d+"</syntaxhighlight>. If defined, the identifier '''must''' pass this test first. If there are relevant regexp strings on Wikidata, they will be checked as well, but after that. * <samp>genitive</samp> β This is a variable that determines whether to use genitive in the article name that replaces <samp>$1</samp> (see above). This can be either <syntaxhighlight lang="lua" inline>true</syntaxhighlight> or <syntaxhighlight lang="lua" inline>false</syntaxhighlight>. * <samp>track</samp> β This is a variable that determines whether to use this property to include the article in a category. The category is controlled by the definition further down (<code>['tracking-cat-found-data']</code> or <code>['tracking-cat-found-local']</code>). This can be either <syntaxhighlight lang="lua" inline>true</syntaxhighlight> or <syntaxhighlight lang="lua" inline>false</syntaxhighlight>. See also the definition of the maximum number of links that will appear in the articles in the <samp>limits</samp> variable as <syntaxhighlight lang="lua" inline>['links-shown'] = 10</syntaxhighlight>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:In lang
(
edit
)