Help talk:Magic words

Latest comment: 12 days ago by StefenTower in topic Function for number of links on a page

Established consensus on where to place magic words?

edit

I’ve done a brief read of this page, Help:Magic words for beginners, and a few of the variables’ documentations, but I can’t find much of an inclination as to where each of the magic words should be placed on a page. While a few of them would fall under WP:COMMONSENSE, I can’t help but wonder if there is consensus on the matter. — Mugtheboss (talk) 16:56, 13 September 2023 (UTC)Reply

It depends on the situation and the magic words in question.
Which ones were you thinking of? - jc37 19:21, 13 September 2023 (UTC)Reply
All of them as a whole, I’m thinking that it would be good if there was a section in one of the two pages that describes where to place each one. — Mugtheboss (talk) 07:32, 14 September 2023 (UTC)Reply
It doesn't make sense to recommend placement on a page for all of the magic words. There is no recommended place to put {{CURRENTHOUR}}, for example. It is used where it is needed. – Jonesey95 (talk) 15:41, 14 September 2023 (UTC)Reply
{{CURRENTHOUR}} would be one of those examples that falls under WP:COMMONSENSE as the output is in UTC, but what about something like {{SITENAME}}? Everyone knows what site we’re on, and in the majority of instances, it’s faster to type it out. What about {{formatnum}}/{{formatnum|R}}? There’s no immediate use for these that springs to mind other than automated edits by bots.
I was originally drawn to this page because I found an article (I can’t remember which) with {{DISPLAYTITLE}} at the end of the lead, and it was creating an ugly extra line. I came to the aforementioned pages to find guidance on if I could move it to mitigate the issue, and got no help. It would make sense to educate people on how magic words are responsibly placed to open more avenues for editors — it would be irritating for me, you, or another editor to place hundreds of magic words, just to realise they were all placed wrong. — Mugtheboss (talk) 21:04, 14 September 2023 (UTC)Reply
WP:ORDER explains where to put SHORTDESC, DISPLAYTITLE, magic words related to ToC, and DEFAULTSORT. —⁠andrybak (talk) 23:19, 14 September 2023 (UTC)Reply
I meant to link to WP:ORDER from this section earlier. I have added a short note to the lead of this page, along with a link. – Jonesey95 (talk) 00:39, 15 September 2023 (UTC)Reply
I completely forgot that WP:ORDER explains where DISPLAYTITLE should be placed.   Self-trout. — Mugtheboss (talk) 08:48, 15 September 2023 (UTC)Reply
I have now found the page and fixed the issue. — Mugtheboss (talk) 08:58, 15 September 2023 (UTC)Reply

Forcing evaluation of the Magic Words.

edit

Is there any way that I can add {{CURRENTYEAR}} to the text of a page and have the actual text stored being the evaluation of the magic word, so 2024 ends up in the text.Naraht (talk) 22:02, 17 February 2024 (UTC)Reply

@Naraht: Yes: {{subst:CURRENTYEAR}} yields 2024. -- John of Reading (talk) 08:25, 18 February 2024 (UTC)Reply

"Wikipedia:Parser function" listed at Redirects for discussion

edit

  The redirect Wikipedia:Parser function has been listed at redirects for discussion to determine whether its use and function meets the redirect guidelines. Readers of this page are welcome to comment on this redirect at Wikipedia:Redirects for discussion/Log/2024 May 18 § Wikipedia:Parser function until a consensus is reached. TechnoSquirrel69 (sigh) 03:37, 18 May 2024 (UTC)Reply

edit

Is there a function for showing the number of unique mainspace links on a page? I know I can use PetScan to produce a list of these, but for WikiProject statistics purposes, I would like to show the total number of them for a page with {{Database report}} having article links as output. Stefen Towers among the rest! GabGruntwerk 23:02, 1 July 2024 (UTC)Reply