Help talk:Magic words

This is an archived version of this page, as edited by Omniplex (talk | contribs) at 18:52, 22 May 2006 (CURRENTWEEK: copy / move from Help talk:Variable). It may differ significantly from the current version.

Latest comment: 19 years ago by Omniplex in topic CURRENTWEEK

ToC copy

I'm trying to insert in one page the TOC of another one. I've only been able of inserting one whole page (see this), but would be nice to hide the content. How could I do it? Is there any magic word? Thanks. --Micru 19:47, 5 October 2005 (UTC)Reply

I don't think that there is an existing feature for that. If you really want it, ask for it at MediaZilla (although I am not sure such feature would be a good idea). --Mormegil 10:29, 1 November 2005 (UTC)Reply

NUMBEROFARTICLES

Is there a token similar to NUMBEROFARTICLES that displays the number of *all* entries in the database, instead of just those big enough to be considered an "article" by the engine? -- Schnee 04:09, 26 December 2005 (UTC)Reply

Number of articles in a specific category

Hi, is it possible to get the number of articles of a certain category, like the one that is displayed on category pages. I want to use it in a table of contents like: Category A (3), Category B (7), Category C (-). --Rudy, Jan 5th 2005


HOME variable

There should be a variable called HOME or something like that which is equivalent to User:xxxxx where xxxxx is the name of the currently-logged in user. Otheus 01:28, 16 January 2006 (UTC)Reply

own Variable

Hi, how can i make a own MagicWord?

For you own sanity, leave it to the developers. I tried monkeying with it and ended up giving up. -- Nexis 02:31, 17 May 2006 (UTC)Reply

Other keyword?

I saw another keyword, but I wasn't sure if version dependent or installation customization.

//meta.wikimedia.org/w/index.php?title=Help_talk:Magic_words&action=edit
  • (from the Stub Template?)

--Iain 00:27, 31 January 2006 (UTC)Reply


FULLPAGENAME added. -- Omniplex (w:t) 06:06, 27 March 2006 (UTC)Reply

Category modifiers

Where are things like <noinclude> or <includeonly> described? Shouldn't they be on this page somewhere? --Connel MacKenzie 04:05, 7 February 2006 (UTC)Reply

No, not here. There are more Wiki tags, <gallery>, <inputbox> (sp?), <references> & Co. They certainly should be somewhere, maybe create a list of this stuff? Omniplex 05:34, 27 March 2006 (UTC)Reply
P.S.: And of course then add a link from here under "See also"

{{raw:MediaWiki:Clearyourcache}}

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.

Is raw:MediaWiki: the same as INT: by chance? Test:

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
Apparently, but I tested only English. Or is it like action=raw? Test with {{raw:Template:!}}:
Next test with {{raw:Template:CURRENTDAY2}}:

21

Okay, templates are evaluated. Where would I need this? w:User:Omniplex 05:12, 27 March 2006 (UTC)Reply
Straight into an edit conflict, I've not yet created a cookie for the new account (see below, thanks).
After some testing, raw is apparently the same as msg ?!? -- Omniplex (w:t) 08:44, 27 March 2006 (UTC)Reply

What does {{raw:..}} do?

What does raw do? I do not see what that magic word does. And what does &action=render do? --84.156.117.226 11:33, 27 March 2006 (UTC)Reply

Check it out, straight from the ___location field of my browser while typing this (replacing action=submit etc. by action=render):
http://meta.wikimedia.org/w/index.php?title=Help_talk:Magic_words&action=render
{{raw:unclear}} is [unclear], it can't simply be the same as {{unclear}} [unclear], it's probably something like msg with a special effect under certain conditions, please tell us if you find the solution. Question also posted on w:WP:VP/T, maybe it's already answered. -- Omniplex (w:t) 13:38, 30 March 2006 (UTC)Reply

Magic words reorganisation

Copied from the [[Help:Magic words]] talk page on Wikipedia:

Copied from m:User_talk:217.251.172.172 (I can't create an account there, its inline PNG captcha doesn't work with my browser, see "account" in WP:VP/T):

I see you're reorganising Help:Magic words. I don't understand what system you're using, though; how are #redirect and __MAGIC__ terms related to formatting? // Pathoschild 02:29, 27 March 2006 (UTC)Reply
#REDIRECT is a bogey, now moved to "misc.". The rest is simply the remaining stuff with two underscores like __NOEDITSECTION__ (that's often useful to suppress edit links in the noinclude part of a template, somewhat related to the ToC magic words). REVISIONID belongs to PAGENAME & Co., it's used to create Permalinks, see Help:Variable. -- Omniplex 04:17, 27 March 2006 (UTC)Reply
I created the account Omniplex and emailed you the login information. :) // Pathoschild (admin / talk) 04:27, 27 March 2006 (UTC)Reply
Thanks, much better now, finally I can set the edit window to a size working in my browser window, use the classic skin, etc. -- Omniplex (w:t) 05:55, 27 March 2006 (UTC)Reply

I don't think they're related to the table of contents. The only similarity I can see is that the words affect headings, and the table of contents is a list of headings. The words don't have any effect on the table itself, though. // Pathoschild 04:34, 27 March 2006 (UTC)Reply

Maybe my POV is somewhat skewed, I needed the TOC, FORCETOC, NOEDITSECTION magic in similar templates like w:Template:Doctl. If you know a good name for the "NO"..."START" table let's split "Formatting", but keep the underscore magic adjacent (below the ToC magics). How about "Nonomagic" (that joke misses anybody who doesn't know vi). Testing new signature: Omniplex 05:26, 27 March 2006 (UTC)Reply

Currentday with leading 0 when <10?

For RFC 3339 / ISO 8601. -- Jeandré, 2006-03-27t18:47z

{{CURRENTDAY2}} = 21, {{CURRENTDAY}} = 21. -- Omniplex (w:t) 05:18, 3 April 2006 (UTC)Reply
  -- Jeandré, 2006-04-03t19:33z

CS vs. CZ

For unknown reasons [[cs:|foo]] doesn't work on Wikipedia, test it there, no such issue with [[cz:|bar]]. The fullurl examples were too wide, I've replaced <code> by <small> again, but now consistent for all three cases where an URL is shown (incl. SERVER), so that should be okay for any browser, no typographical mess anymore. 09:10, 4 April 2006 (UTC) -- Omniplex (w:t)

That was complete nonsense, on en:w: it only needs a leading colon [[:cs:]] and here on Meta that colon also works. Besides [[cz:]] never really worked anywhere, it was only shown as link (unlike [[cs:]] on w:en:). -- Omniplex (w:t) 01:30, 2 May 2006 (UTC)Reply

New magic words

The new magic words {{TALKSPACE}}, {{TALKSPACEE}}, {{SUBJECTSPACE}}, {{SUBJECTSPACEE}}, {{TALKPAGENAME}}, {{TALKPAGENAMEE}}, {{SUBJECTPAGENAME}} and {{SUBJECTPAGENAMEE}} have MW 1.6+ tag but does not work even on 1.6.3. Did you mean 1.7+? Borgx 09:08, 14 April 2006 (UTC)Reply

Maybe. I can't tell, I've only tuned the table, please fix 1.7 if you think that that's we're using. Special:Version says 1.7alpha  at the moment, whatever that means. -- Omniplex (w:t) 09:46, 14 April 2006 (UTC)Reply

Raw modifier

{{NUMBEROFUSERS}}, {{NUMBEROFFILES}} and {{NUMBEROFARTICLES}} will now all accept a "raw" modifier, e.g. {{NUMBEROFUSERS|R}}. (fixed on r.13978). Thanks to Robchurch. Borgx 00:21, 1 May 2006 (UTC)Reply

Added. -- Omniplex (w:t) 01:32, 2 May 2006 (UTC)Reply
Very useful addition. Thanks. --CBDunkerson 13:42, 5 May 2006 (UTC)Reply

New magic word

New magic word __NEWSECTIONLINK__ introduced to mw r14009 (bugzilla:4876. This magic word will force page to have plus (+) button at the top of page (new section). Borgx 00:24, 2 May 2006 (UTC)Reply

Just add what you find, this is a Wiki, bold, self-healing, the works... ;-) -- Omniplex (w:t) 01:34, 2 May 2006 (UTC)Reply

Hi Omniplex, I added here instead of main page because my english is bad :) Borgx 01:37, 2 May 2006 (UTC)Reply

Okay, I try it with my DEnglish... :-) -- Omniplex (w:t) 02:08, 2 May 2006 (UTC)Reply
Failed, I've no clue what it's supposed to do, apparently it doesn't work yet. I've also no idea what {{DISPLAYTITLE}} does, if anything. -- Omniplex (w:t) 02:52, 2 May 2006 (UTC)Reply

Yes, ofcourse it will failed, because it will work only on revision 14009+, meta currently below that (it seems). Borgx 02:57, 2 May 2006 (UTC)Reply

Special:Version says 1.7alpha r13760 here, also on w:en: - at least the "R" format for the numbers works. -- Omniplex (w:t) 03:04, 2 May 2006 (UTC)Reply

The svn revision info seems to not working also, which now i complain to robchurch at #mediawiki. {{NUMBEROFUSERS}} also supposed to work on 13916+ , but it works now on meta (13760?). I also fillup bugzilla:5784 Borgx 03:10, 2 May 2006 (UTC)Reply

The revision number seems correct now. Borgx 01:48, 9 May 2006 (UTC)Reply

Magic word for main title of page?

Given a page named "Wikipedia:Today's featured article/April 11, 2006", I can get "Wikipedia" with NAMESPACE and "April 11, 2006" with SUBPAGENAME. Is there any way to extract out "Today's featured article"? It would be very useful to be able to identify a 'TITLEPAGENAME' like this so that conditions could be set for all sub-pages based on the main (simplifying and improving w:Template:FCpages) or a link constructed by adding a computed date to a title page name (vastly simplifying w:Template:Day+1). --CBDunkerson 14:01, 5 May 2006 (UTC)Reply

Patrick created some interesting examples at Help:Link/a and Link/a. The latter is a namespace supporting subpages, and you can get some interesting effects with "../". The former namespace Help on Meta doesn't support subpages. Your case is the latter, because SUBPAGENAME works for you. -- Omniplex (w:t) 12:01, 8 May 2006 (UTC)Reply

Robchurch has added new magic words {{BASEPAGENAME}} and {{BASEPAGENAMEE}} for this. Just wait for r.14212 (bugzilla:5845). Borgx 05:05, 14 May 2006 (UTC)Reply

No html auto-completion for template

I'm not sure if this is the right place to ask (and would welcome redirection to the right spot if it's somewhere else), but I'm wondering if there's a "Magic word" to prevent the html in a template from being auto-completed.

For example, I have a template with an html div open tag "<div>" (lets call it "Header") and a matching template with an html div close tag "</div>" (lets call it "Footer"). I want to use these two templates to wrap around content. E.g:

{{Header}}
content
{{Footer}}

On older versions of the MediaWiki software this seems to work (such as the version currently in use by Wikipedia). But, on newer versions (such as 1.6.3 which I'm running on my own server), the software will insert a closing </div> tag right after the end of the first template - preventing the wrapping of the content that I'm wanting. The result looks like:

<div></div>
content
&lt;/div&gt;

So, is there a Magic Word I can put in my Header template to prevent that unwanted div close tag? Thanks. —GrantNeufeld 06:01, 10 May 2006 (UTC)Reply

It works for me.
Template A with:
<div> Hi
Page B with
{{A}} World
</div>
Shows Hi World, with source code:
<div>Hi World</div>
Platonides 13:39, 14 May 2006 (UTC)Reply
Odd. I'm forced to guess:
  1. - some templates like w:en:Template:Wrapper as shown on en:Template_talk:- work perfectly - or at least they used to work a few weeks ago. It starts a table floating right (+ backwards compatible align="right") completed later manually.
  2. - AFAIK auto-completion is the normal specified behaviour for HTML, you can omit some end and even a few start tags in HTML. In XHTML that's fortunately not more allowed, and the tool "tidy" can fix it in most cases (= add missing start or end tags).
  3. - not all Wikis use "tidy", but Meta and the English Wikipedia do.
  4. - the HTML auto-completion can introduce subtle oddities. Example:
    If you're within an open paragraph and start preformatted text with <pre>, then this would result in </p><pre>. So far no issue. But if you had an explicit </p> later behind the <pre> it would be invalid (missing a corresponding start tag) and could have odd effects.
  5. - that's all completely unrelated to templates, "tidy" works on whatever it gets after templates and Wiki markup are translated to wannabe-XHTML, it only fixes obvious errors. The only "tidy"-bug I know is mediazilla:5569.
  6. - If there's a rule that templates can't start a <div> unless they also finish it this would be very strange, especially if there's no similar restriction for tables. In theory it should be possible to start any page with <div align="center"> and end it with </div>, no matter how you do it, including templates. If you forget the closing tag "tidy" should add it near the end of the page (on Wikis using "tidy" - otherwise it's just invalid XHTML, and my ten years old browser might be confused ;-) -- Omniplex (w:t) 15:24, 14 May 2006 (UTC)Reply

CURRENTWEEK

Since CURRENTWEEK follows the ISO year and not the calendar year, there needs to be a new Magic word for CURRENTISOYEAR. As it is, a CURRENTWEEK/CURRENTYEAR combo will not work when the calendar year is different from the ISO year. See the ISO 8601 section on weeks for the boring details.

Ideally, CURRENTWEEK would use a standard that followed the CURRENTYEAR calendar year and there would be a new CURRENTISOWEEK and CURRENTISOYEAR that followed the ISO week and year. Of course, being an ugly American, I vote for a CURRENTUSAWEEK as well to follow our arguably stupid Sunday-Monday partial weeks up to 54 system, but I could really care less as long as I can have a WEEK that agrees with a YEAR all of the time.

Alternatively, perhaps one's "weeking" system should be an admin setting for a Wiki. —BozoTheScary 18:46, 15 May 2006 (UTC)Reply

On rereading of the ISO 8601 article, perhaps CURRENTWEEKYEAR would be better than CURRENTISOYEAR, since there is no indication that any other ISO notation than the week notation would ever use a year other than the calendar year. —BozoTheScary 18:55, 15 May 2006 (UTC)Reply

See w:en:Template:CURRENTISOYEAR.--Patrick 01:08, 16 May 2006 (UTC)Reply
Groovy. Since that is implemented in Wikipedia, but not in the MediaWiki distro, is there a way I can use it in my personal wiki? —BozoTheScary 02:42, 16 May 2006 (UTC)Reply
If it is new enough to have all required variables, you additionally need to copy this template and the templates it uses.--Patrick 21:20, 16 May 2006 (UTC)Reply

CURRENTWEEKYEAR

Copied / moved from Help talk:Variable

I've no clue what that's about and removed it. At the moment the formerly "unclear" CURRENTWEEK 1..52 vs. 1..54 converges at 1..53 here and also on Help:Magic words.

7*53 is 371 - do we have a category for "talk pages using parser functions"? Just kidding. Non-leap years have 365 days, 371-365 is 6. What's the problem with 2007-12-31?

You said it's a Monday, checking: 1, (0 = Sunday), okay, it's a Monday. And you said it has CURRENTWEEK 1, because it belongs to the first week in 2008. Why isn't it in week 53 of 2007? -- Omniplex (w:t) 20:51, 21 May 2006 (UTC)Reply

See w:ISO_8601#Week_dates. A week has only one number, even if it contains days in two years.--Patrick 22:45, 21 May 2006 (UTC)Reply
See also Help_talk:Magic_words#CURRENTWEEK.--Patrick 23:24, 21 May 2006 (UTC)Reply
Okay, ISO uses week numbers 01..53 and again 01 within certain years together with day numbers 1..7.
The latter is different from CURRENTDOW, are you sure that CURRENTWEEK reflects the former? The old CURRENTWEEK info was 1..54, I added "unclear", somebody explained it, but I don't recall who replaced 54 by 53 why and when. Maybe using 0..54 could work, 0 for "actually the rest of ISO week 53 in the previous year", 54 for "actually the begin of ISO week 1 in the next year" (?).
We need pointers to the CURRENTWEEK code, and assuming it's some built-in PHP function to the docu of this function. -- Omniplex (w:t) 18:46, 22 May 2006 (UTC)Reply

DISPLAYTITLE

It looks to me like {{DISPLAYTITLE}} has something to do with changing the display of the article title.

From DefaultSettings.php:

/**
 * Allow DISPLAYTITLE to change title display
 */
$wgAllowDisplayTitle = false ;

Can anyone verify this?

-- Nexis 02:19, 17 May 2006 (UTC)Reply

Return to "Magic words" page.