Content deleted Content added
Cobaltcigs (talk | contribs) ok |
|||
(5 intermediate revisions by 5 users not shown) | |||
Line 1:
{{WikiProject banner shell|
{{WikiProject Short descriptions}}
}}
== Testing ==
{| class="wikitable"
Line 51 ⟶ 54:
{{unindent}} 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 <code><nowiki>{{SHORTDESC:...|...}}</nowiki></code> "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; }
</syntaxhighlight>
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 <code>noreplace</code> 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. ―[[special:contributions/cobaltcigs|cobaltcigs]] 19:50, 4 October 2020 (UTC)
:
: If you're going to use JavaScript then you can access the API and read the value of "Local description" from the "Page information" for each article (there's a link to it in the left margin box called 'tools'). That's where the backend database stores the overriding value supplied by the {{tl|short description}} via the <nowiki>{{SHORTDESC:}}</nowiki> magic word. If you want to understand better about how the 'noreplace' parameter works, you should check out [[phab:T193857]] where we thrashed out the logic of it. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 02:02, 5 October 2020 (UTC)
|