Article | Wikidata description | Short description | Category |
---|---|---|---|
Douglas Adams (Q42) | English author and humourist (1952–2001) | English author and humorist (1952–2001) | Category:Short description is different from Wikidata |
Christian art (Q645717) | art genre | Art genre | Category:Short description matches Wikidata |
Resultado do tratamento das fístulas enterovesicais para doença de Crohn (Q58861153) | Category:Short description with empty Wikidata description |
@ IceWelder: What is the point of this edit? Why would this module be used on a wiki where Wikidata is unavailable, and why would it be a good idea to populate the "different" tracking category with every single use if that were the case? * Pppery * it has begun... 16:37, 16 August 2020 (UTC)
So I found my way here from there. Forgetting about wikidata for a second, would it somehow be possible to detect pages with multiple local short descriptions? That would be an issue infinitely more worthy of maintenance categorization, especially when these do not match. I believe the most common scenario will be one description manually entered in the article's wikitext, and the other automatically generated from infobox parameters (which may or may not be positioned in that order, which may or may not matter—please advise). ― cobaltcigs 14:36, 28 September 2020 (UTC)
noreplace
parameter. Having the noreplace parameter prevents the short description from replacing any earlier defined short description, so the order won't matter: any explicit use of {{
short description}} will override a generated one.hastemplate:"Infobox settlement" hastemplate:"short description"
, for example (and repeat for each of the other 36 templates in
Category:Templates that generate short descriptions). There are currently 527,822 articles with both {{
Infobox settlement}} and {{
short description}}. --
RexxS (
talk)
17:18, 28 September 2020 (UTC)
<div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">
. This makes it difficult to confirm which description (if any) has taken precedence. ―
cobaltcigs
03:33, 4 October 2020 (UTC)
mw.title.getCurrentTitle():getContent()
method to read the current page's unparsed content, and finding the templates is trivial, but you won't be able to compare the contents unless you use mw.getCurrentFrame():expandTemplate{}
to explicitly expand the generated template or require
Module:Settlement short description and call it. Frankly, I wouldn't bother.noreplace
being added in the generator – see
Module:Settlement short description line 30. --
RexxS (
talk)
18:06, 4 October 2020 (UTC) Okay so some amount of research later, I've come to realize this "noreplace" parameter is actually passed along as the second parameter to a certain {{SHORTDESC:...|...}}
"magic word"—and that this mechanism is totally separate from the hidden(-by-default) span tag, which only uses the first parameter. Fair enough. I suppose I was preoccupied with the span tag because I use client-side css like this to make the description (or potentially multiple descriptions) clearly visible:
.shortdescription { display: block !important; color: red; white-space: pre-wrap; font-family: monospace; font-size: larger; width: auto; border-bottom: 1px dashed black; }
.shortdescription::before { content: "{{short description|"; color: black; }
.shortdescription::after { content: "}}"; color: black; }
As designed I don't see any robust way to identify and unhide only the description that, based on whatever internal noreplace-logic, is ultimately used. Perhaps the name noreplace
could be appended to the span's list of classes, when applicable. Then one could at least use javascript to examine the spans' classes and decide by elimination which one to unhide. ―
cobaltcigs
19:50, 4 October 2020 (UTC)
Article | Wikidata description | Short description | Category |
---|---|---|---|
Douglas Adams (Q42) | English author and humourist (1952–2001) | English author and humorist (1952–2001) | Category:Short description is different from Wikidata |
Christian art (Q645717) | art genre | Art genre | Category:Short description matches Wikidata |
Resultado do tratamento das fístulas enterovesicais para doença de Crohn (Q58861153) | Category:Short description with empty Wikidata description |
@ IceWelder: What is the point of this edit? Why would this module be used on a wiki where Wikidata is unavailable, and why would it be a good idea to populate the "different" tracking category with every single use if that were the case? * Pppery * it has begun... 16:37, 16 August 2020 (UTC)
So I found my way here from there. Forgetting about wikidata for a second, would it somehow be possible to detect pages with multiple local short descriptions? That would be an issue infinitely more worthy of maintenance categorization, especially when these do not match. I believe the most common scenario will be one description manually entered in the article's wikitext, and the other automatically generated from infobox parameters (which may or may not be positioned in that order, which may or may not matter—please advise). ― cobaltcigs 14:36, 28 September 2020 (UTC)
noreplace
parameter. Having the noreplace parameter prevents the short description from replacing any earlier defined short description, so the order won't matter: any explicit use of {{
short description}} will override a generated one.hastemplate:"Infobox settlement" hastemplate:"short description"
, for example (and repeat for each of the other 36 templates in
Category:Templates that generate short descriptions). There are currently 527,822 articles with both {{
Infobox settlement}} and {{
short description}}. --
RexxS (
talk)
17:18, 28 September 2020 (UTC)
<div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">
. This makes it difficult to confirm which description (if any) has taken precedence. ―
cobaltcigs
03:33, 4 October 2020 (UTC)
mw.title.getCurrentTitle():getContent()
method to read the current page's unparsed content, and finding the templates is trivial, but you won't be able to compare the contents unless you use mw.getCurrentFrame():expandTemplate{}
to explicitly expand the generated template or require
Module:Settlement short description and call it. Frankly, I wouldn't bother.noreplace
being added in the generator – see
Module:Settlement short description line 30. --
RexxS (
talk)
18:06, 4 October 2020 (UTC) Okay so some amount of research later, I've come to realize this "noreplace" parameter is actually passed along as the second parameter to a certain {{SHORTDESC:...|...}}
"magic word"—and that this mechanism is totally separate from the hidden(-by-default) span tag, which only uses the first parameter. Fair enough. I suppose I was preoccupied with the span tag because I use client-side css like this to make the description (or potentially multiple descriptions) clearly visible:
.shortdescription { display: block !important; color: red; white-space: pre-wrap; font-family: monospace; font-size: larger; width: auto; border-bottom: 1px dashed black; }
.shortdescription::before { content: "{{short description|"; color: black; }
.shortdescription::after { content: "}}"; color: black; }
As designed I don't see any robust way to identify and unhide only the description that, based on whatever internal noreplace-logic, is ultimately used. Perhaps the name noreplace
could be appended to the span's list of classes, when applicable. Then one could at least use javascript to examine the spans' classes and decide by elimination which one to unhide. ―
cobaltcigs
19:50, 4 October 2020 (UTC)