Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
||
Line 712:
:::::{{u|Sdkb}}, I was not aware of that module being able to do so, nor of the existence of <code>mw.title.getCurrentTitle():getContent()</code> that it uses to get the actual article text. I'll further look into this. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]] [[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 23:03, 10 February 2021 (UTC)
::::::I've mentioned at VPT [[Wikipedia:Village_pump_(technical)#Date_formatting_outside_citations|here]], as there's some wider applicability to being able to respect date formats outside just citations. <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 03:03, 15 February 2021 (UTC)
== Capitalise first letter ==
What's the easiest way to capitalise the first letter of a word obtained from Wikidata? I think ucfirst will not work on a link or if references are appended. Thanks — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 19:18, 23 January 2021 (UTC)
:It's indeed not possible to capitalise the first letter, unless you make it appear capitalised using CSS. Please see the [[Module talk:Wd/Archive_1#ucfirst|previous discussion]] about this. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]] [[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 17:36, 10 February 2021 (UTC)
:: [[Module:String2]] has a "smart" ucfirst function that finds the first item in a list and capitalises it. It also works with piped links.
:: <code><nowiki>{{#invoke:String2| ucfirst | human X chromosome }}</nowiki></code> → {{#invoke:String2| ucfirst | human X chromosome }}
:: <code><nowiki>{{#invoke:String2| ucfirst | [[chromosome]] }}</nowiki></code> → {{#invoke:String2| ucfirst | [[chromosome]] }}
:: <code><nowiki>{{#invoke:String2| ucfirst | [[Chromosome|human X chromosome]] }}</nowiki></code> → {{#invoke:String2| ucfirst | [[Chromosome|human X chromosome]] }}
:: <code><nowiki>{{#invoke:String2| ucfirst | {{ubl | human | cat | dog }} }}</nowiki></code> → {{#invoke:String2| ucfirst | {{ubl | human | cat | dog }} }}
:: <code><nowiki>{{#invoke:String2| ucfirst | {{ubl | [[human]] | [[cat]] | [[dog]] }} }}</nowiki></code> → {{#invoke:String2| ucfirst | {{ubl | [[human]] | [[cat]] | [[dog]] }} }}
:: Hope that helps. --[[User:RexxS|RexxS]] ([[User talk:RexxS|talk]]) 21:46, 20 February 2021 (UTC)
|