Langbahn Team – Weltmeisterschaft

Help talk:Magic words: Difference between revisions

Content deleted Content added
183.171.184.131 (talk)
Tag: Reverted
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

WikiProject iconWikipedia Help NAโ€‘class Lowโ€‘importance
WikiProject iconThis page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
NAThis page does not require a rating on the project's quality scale.
LowThis page has been rated as Low-importance on the project's importance scale.

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)[reply]

@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)[reply]
(late response) Doh! Just didn't see that. โ€”[AlanM1(talk)]โ€” 01:01, 4 December 2019 (UTC)[reply]

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)[reply]

@MoonyTheDwarf: Maybe because it doesn't exist. It's certainly doing nothing in your post. --Redrose64 ๐ŸŒน (talk) 22:40, 6 October 2019 (UTC)[reply]
@Redrose64: It exists, but should never be used directly. See Wikipedia:Short description#Implementation. -- John of Reading (talk) 02:46, 7 October 2019 (UTC)[reply]
Oh, they mean {{SHORTDESC: }}. The braces and colon are significant: not all magic words use them. --Redrose64 ๐ŸŒน (talk) 08:21, 7 October 2019 (UTC)[reply]

__NOGLOBAL__

I cannot see __NOGLOBAL__ as magic word. [1]. --BoldLuis (talk) 14:13, 12 May 2020 (UTC)[reply]

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)[reply]

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)[reply]

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)[reply]
@Sdkb: What Jonesey95 just said. - dcljr (talk) 21:48, 17 May 2020 (UTC)[reply]
@Dcljr and Jonesey95: thanks both! {{u|Sdkb}}โ€ฏtalk 21:56, 17 May 2020 (UTC)[reply]
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)[reply]
... 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)[reply]
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)[reply]
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)[reply]
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)[reply]

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:

but the parser functions in mw:Help:Extension:ParserFunctions don't seem to be working, e.g.:

  • {{#len:magic}}
  • {{#sub:magic|2}}
  • Is my syntax wrong, or is the aforementioned extension simply disabled in WP.en? โ€” ๐†๐ฎ๐š๐ซ๐š๐ฉ๐ข๐ซ๐š๐ง๐ ๐š (talk) 13:13, 8 May 2021 (UTC)[reply]

    @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)[reply]
    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)[reply]
    @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)[reply]
    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)[reply]

    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)[reply]

    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)[reply]