Help talk:Magic words: Difference between revisions
183.171.184.131 (talk) โSemi-protected edit request on 5 October 2021: new section Tag: Reverted |
โSemi-protected edit request on 5 October 2021: delete malformed ER Tags: Manual revert Reverted |
||
Line 84: | Line 84: | ||
[[Special:Contributions/183.171.184.131|183.171.184.131]] ([[User talk:183.171.184.131|talk]]) 14:02, 5 October 2021 (UTC){{edit set}} [[Special:Contributions/183.171.184.131|183.171.184.131]] ([[User talk:183.171.184.131|talk]]) 14:02, 5 October 2021 (UTC) |
[[Special:Contributions/183.171.184.131|183.171.184.131]] ([[User talk:183.171.184.131|talk]]) 14:02, 5 October 2021 (UTC){{edit set}} [[Special:Contributions/183.171.184.131|183.171.184.131]] ([[User talk:183.171.184.131|talk]]) 14:02, 5 October 2021 (UTC) |
||
== Semi-protected edit request on 5 October 2021 == |
|||
{{edit semi-protected|Help:Magic words|answered=no}} |
|||
[[Special:Contributions/183.171.184.131|183.171.184.131]] ([[User talk:183.171.184.131|talk]]) 14:04, 5 October 2021 (UTC) |
Revision as of 14:34, 5 October 2021
Wikipedia Help NAโclass Lowโimportance | ||||||||||
|
This page has archives. Sections older than 730 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Inconsistency
At Help:Magic words#General information:
- The first parameter's syntax differs. In {{#magic: p1| p2 | p3}}, the name is #magic and it will be followed by an unspacedย : colon and a required input parameter, p1. The first
|p1=
of a template is optional but would be preceded by a | pipe instead of aย : colon.
This seems inconsistent. The second sentence says p1 is mandatory, but the third says it's optional and would apparently be called as {{#magic|p1=...}}
? โ[AlanM1(talk)]โ 08:11, 27 March 2019 (UTC)
- @AlanM1: The second sentence is describing a parameter passed to a magic word. The third sentence is describing a parameter passed to a template. This is part of a section trying to compare magic words and templates. -- John of Reading (talk) 09:04, 27 March 2019 (UTC)
- (late response) Doh! Just didn't see that. โ[AlanM1(talk)]โ 01:01, 4 December 2019 (UTC)
SHORTDESC
There is no documentation on this page for the SHORTDESC magic word. โย Preceding unsigned comment added by MoonyTheDwarf (talk โข contribs) 16:59, 6 October 2019 (UTC)
- @MoonyTheDwarf: Maybe because it doesn't exist. It's certainly doing nothing in your post. --Redrose64 ๐น (talk) 22:40, 6 October 2019 (UTC)
- @Redrose64: It exists, but should never be used directly. See Wikipedia:Short description#Implementation. -- John of Reading (talk) 02:46, 7 October 2019 (UTC)
- Oh, they mean
{{SHORTDESC: }}
. The braces and colon are significant: not all magic words use them. --Redrose64 ๐น (talk) 08:21, 7 October 2019 (UTC)
- Oh, they mean
- @Redrose64: It exists, but should never be used directly. See Wikipedia:Short description#Implementation. -- John of Reading (talk) 02:46, 7 October 2019 (UTC)
__NOGLOBAL__
I cannot see __NOGLOBAL__ as magic word. [1]. --BoldLuis (talk) 14:13, 12 May 2020 (UTC)
- Reading the gerrit that you provided, I think that it's not going to be useful here - it's mainly of use at meta:. But it is documented - in a fashion - at mw:Help:Magic words. --Redrose64 ๐น (talk) 17:28, 12 May 2020 (UTC)
REVISIONTIMESTAMP conversion to plain text
The REVISIONTIMESTAMP magic word gives a string of numbers. Is there any easy way to convert it to a human-readable format? This would be nice for {{Closing}}. (please use {{ping|Sdkb}}
on reply) {{u|Sdkb}}โฏtalk 03:13, 17 May 2020 (UTC)
- The #time function will probably help you.
{{#time:H:i, j F Y|{{REVISIONTIMESTAMP}}}}
. See mw:Help:Extension:ParserFunctions##time for time options. โ Jonesey95 (talk) 05:10, 17 May 2020 (UTC)- @Sdkb: What Jonesey95 just said. - dcljr (talk) 21:48, 17 May 2020 (UTC)
- @Dcljr and Jonesey95: thanks both! {{u|Sdkb}}โฏtalk 21:56, 17 May 2020 (UTC)
- You might like to put the time zone in too, to make it more resilient for scripts and bots -
{{#time:H:i, j F Y (e)|{{REVISIONTIMESTAMP}}}}
โ 14:34, 5 October 2021 (UTC). --Redrose64 ๐น (talk) 22:12, 17 May 2020 (UTC) - ... or go with an international format such as โ
{{ #time:Y-m-d H:i:s|{{REVISIONTIMESTAMP}} }}
โ 2021-10-05 14:34:47 โ GhostInTheMachine talk to me 12:10, 16 May 2021 (UTC) - The following is longer, but should format the date according to the different user preferences โ
{{#dateformat:{{ #time:Y-m-d H:i:s|{{REVISIONTIMESTAMP}} }}}}
โ 2021-10-05 14:34:47 โ GhostInTheMachine talk to me 12:10, 16 May 2021 (UTC)
- You might like to put the time zone in too, to make it more resilient for scripts and bots -
- @Dcljr and Jonesey95: thanks both! {{u|Sdkb}}โฏtalk 21:56, 17 May 2020 (UTC)
- Or you can use {{REVISIONDAY}}, {{REVISIONMONTH}} and {{REVISIONYEAR}} instead, if it suits you better. I wonder why these are all deemed "expensive functions" (when addressed at a different page), though. โ ๐๐ฎ๐๐ซ๐๐ฉ๐ข๐ซ๐๐ง๐ ๐ (talk) 00:46, 16 May 2021 (UTC)
- Expensive generally implies an extra database request. The revision date is available for the current page, but it needs an extra database request to get the same information for a different page. In this case, the first REVISION function for a different page will be expensive, but the other 2 should then get the information from the cached data โ GhostInTheMachine talk to me 13:05, 16 May 2021 (UTC)
- @Sdkb: What Jonesey95 just said. - dcljr (talk) 21:48, 17 May 2020 (UTC)
ParserFunctions extension not working here
The article says:
Further information: mw:Help:Magic words ยง Parser functions, and mw:Help:Extension:ParserFunctions
and
This page is a quick reference for magic words. For more information, refer to the main MediaWiki documentation:
- mw:Help:Magic words: All standard magic words, including the "standard" parser functions.
- mw:Help:Extension:ParserFunctions: Additional parser functions, including conditional expressions.
but the parser functions in mw:Help:Extension:ParserFunctions don't seem to be working, e.g.:
Is my syntax wrong, or is the aforementioned extension simply disabled in WP.en? โ ๐๐ฎ๐๐ซ๐๐ฉ๐ข๐ซ๐๐ง๐ ๐ (talk) 13:13, 8 May 2021 (UTC)
- @Guarapiranga: Most of the ParserFunctions extension is enabled here, but the string functions are not. To check which magic words are available here, go to Special:Version and scroll down to the list of "Parser function hooks" at the bottom. -- John of Reading (talk) 13:42, 8 May 2021 (UTC)
- Thanks, John of Reading.
but the string functions are not.
- Why not? Are they bugged? It'd be great to use them instead of resorting to Lua for simple string operations like #len and #sub. โ ๐๐ฎ๐๐ซ๐๐ฉ๐ข๐ซ๐๐ง๐ ๐ (talk) 13:47, 8 May 2021 (UTC)
- @Guarapiranga: For the history, see MediaWiki#Text manipulation. If you are only looking to use these functions a few times, you could use the templates listed at {{String-handling templates}}. For example, {{str len}} replaces #len. -- John of Reading (talk) 14:08, 8 May 2021 (UTC)
If you are only looking to use these functions a few times
- Yeah, I'm not, hence my interest. Lua breaks after just a few calls in a table (example). Perhaps there's another way to streamline it, but I was hoping this would be it. โ ๐๐ฎ๐๐ซ๐๐ฉ๐ข๐ซ๐๐ง๐ ๐ (talk) 14:14, 8 May 2021 (UTC)
- @Guarapiranga: For the history, see MediaWiki#Text manipulation. If you are only looking to use these functions a few times, you could use the templates listed at {{String-handling templates}}. For example, {{str len}} replaces #len. -- John of Reading (talk) 14:08, 8 May 2021 (UTC)
NOTOC + infobox creates blank line
If an article starts with:
__NOTOC__
{{Info/Organization
ย |nome = Org name
then there will be a blank line at the beginning of the article. I could only get ri of it gluing the NOTOC particle into the infobox invocation:
__NOTOC__{{Info/Organization
ย |nome = Org name
I found that unexpected. fgnievinski (talk) 16:42, 9 August 2021 (UTC)
Semi-protected edit request on 5 October 2021
183.171.184.131 (talk) 14:02, 5 October 2021 (UTC)Template:Edit set 183.171.184.131 (talk) 14:02, 5 October 2021 (UTC)