Help talk:Magic words: Difference between revisions
Richardguk (talk | contribs) →PAGENAME for pages with underscore: Try {{PAGENAMEE}} |
Avicennasis (talk | contribs) m reply to old question and asking a new one! :) . |
||
Line 47: | Line 47: | ||
:: BASEPAGENAME only removes one subpage level, (e. g. [http://de.wikipedia.org/w/index.php?title=Benutzer:Bjs/Babel/Commons&oldid=65205426|here], check the "Benutzerseite" link). Something like TOPPAGENAME would be useful when a template may appear at deeper subpage levels. [[User:Paradoctor|Paradoctor]] ([[User talk:Paradoctor|talk]]) 09:59, 4 October 2009 (UTC) |
:: BASEPAGENAME only removes one subpage level, (e. g. [http://de.wikipedia.org/w/index.php?title=Benutzer:Bjs/Babel/Commons&oldid=65205426|here], check the "Benutzerseite" link). Something like TOPPAGENAME would be useful when a template may appear at deeper subpage levels. [[User:Paradoctor|Paradoctor]] ([[User talk:Paradoctor|talk]]) 09:59, 4 October 2009 (UTC) |
||
:::Yes that would be useful. [[User:Headbomb|Headbomb]] {<sup>[[User talk:Headbomb|ταλκ]]</sup><sub style="margin-left:-4.0ex;">[[Special:Contributions/Headbomb|κοντριβς]]</sub> – [[WP:PHYS|WP Physics]]} 05:57, 22 October 2009 (UTC) |
:::Yes that would be useful. [[User:Headbomb|Headbomb]] {<sup>[[User talk:Headbomb|ταλκ]]</sup><sub style="margin-left:-4.0ex;">[[Special:Contributions/Headbomb|κοντριβς]]</sub> – [[WP:PHYS|WP Physics]]} 05:57, 22 October 2009 (UTC) |
||
{{outdent}}Not really a magic word, but you could use a parser function (#titleparts) to acheieve this effect: |
|||
This function separates a pagetitle into segments based on slashes, then returns some of those segments as output. |
|||
:<tt><nowiki>{{#titleparts:</nowiki> ''pagename'' <nowiki>|</nowiki> ''number of segments to return'' <nowiki>|</nowiki> ''first segment to return'' <nowiki>}}</nowiki></tt> |
|||
If the <tt>number of segments</tt> parameter is not specified, it defaults to "0", which returns ''all'' the segments. If the <tt>first segment</tt> parameter is not specified or is "0", it defaults to "1": |
|||
:<tt><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>}}</nowiki></tt> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' |
|||
:<tt><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| 1 }}</nowiki></tt> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' |
|||
:<tt><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| 2 }}</nowiki></tt> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' |
|||
:<tt><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| 2 | 2 }}</nowiki></tt> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' |
|||
For this and more, see the info posted on [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23titleparts MediWiki] about this. Hope that helps! <sup>[[User:Avicennasis|<font color="red" size="1px">Avic</font>]]</sup>[[User talk:Avicennasis|<font color="blue" size="1px">enna</font>]]<sub>[[Special:Contributions/Avicennasis|<font color="green" size="1px">sis</font>]]</sub> <small>@</small> 20:52, 14 April 2010 (UTC) |
|||
== subst with MWs == |
== subst with MWs == |
||
Line 115: | Line 130: | ||
:: Try editing [[Template:Infobox tz]] to replace <code><nowiki>{{PAGENAME}}</nowiki></code> with <code><nowiki>{{PAGENAMEE}}</nowiki></code>, which is the URL-encoded equivalent. — [[User:Richardguk|Richardguk]] ([[User talk:Richardguk|talk]]) 15:20, 13 March 2010 (UTC) |
:: Try editing [[Template:Infobox tz]] to replace <code><nowiki>{{PAGENAME}}</nowiki></code> with <code><nowiki>{{PAGENAMEE}}</nowiki></code>, which is the URL-encoded equivalent. — [[User:Richardguk|Richardguk]] ([[User talk:Richardguk|talk]]) 15:20, 13 March 2010 (UTC) |
||
==TOC-related Magic Words== |
|||
Is <nowiki>_</nowiki>_NOTOC__ and <nowiki>_</nowiki>_TOC__ supposed to work in Userspace? <sup>[[User:Avicennasis|<font color="red" size="1px">Avic</font>]]</sup>[[User talk:Avicennasis|<font color="blue" size="1px">enna</font>]]<sub>[[Special:Contributions/Avicennasis|<font color="green" size="1px">sis</font>]]</sub> <small>@</small> 20:52, 14 April 2010 (UTC) |
Revision as of 20:52, 14 April 2010
Wikipedia Help NA‑class | |||||||
|
For heavens sake, just what is meant by Magic word???
I sometimes wonder if the computer gurus on Wikipedia know how to speak English!! This article lists jillions of Magic words, but nowhere does it explain what a Magic word is. Please, someone, explain what a Magic word is and do so in plain English that a non-computer guru can understand. If it can be exemplified, give some examples ... also in plain English. - mbeychok 18:41, 26 December 2006 (UTC)
- It is a word that gives the software a specific task to do, such as display the current date, hide the TOC, etc. inline with the text. ffm yes? 22:30, 21 February 2007 (UTC)
- I have copied the latest version from meta that makes that clear. Jon513 13:54, 22 February 2007 (UTC)
- I've added it to the glossary. Libcub (talk) 21:52, 25 February 2008 (UTC)
Defaultsort and talk pages
I left the same question at META, hope to get a reply or fix for this at one place or another...
Is there a reason that the talk pages for articles that have a defaultsort don't "follow" the same sorting? Or, is thre a way to get the talk pages to follow the sorting for the article? For example, the article A Chinese Ghost Story II sorts as "Chinese Ghost Story II, A" but the talk page sorts as Talk:A Chinese Ghost Story II. Is there a need to put a defaultsort on the talk pages too? Hope not! By the by, I noticed this at [1]. SkierRMH 07:52, 6 March 2007 (UTC)
Page view
Is there a magic word to show how many times a page was viewed or accessed? - RyanGibsonStewart (talk) 13:34, 24 August 2007 (UTC)
H:Page name variables
Since all the magic words are listed here is there really a need for H:Page name variables? -Rocket000 20:53, 8 September 2007 (UTC)
Tag extensions
Is there a list of all tag extensions / xml-style tags (such as <math>, <ref> or <source>) that are supported in the Wikipedia MediaWiki installation? --Abdull (talk) 14:35, 9 December 2007 (UTC)
- Special:Version, scroll down to #Parser extension tags ∴ AlexSm 21:44, 9 December 2007 (UTC)
WP:Magic disambig
Would it be possible to have a note at the top of the page mentioning about how WP:MAGIC redirects here and you may be looking for Wikipedia:WikiProject Magic? This is in the same way that WP:NOTE mentions about citations, footnotes and what wikipedia isn't. It is a plausible redirect I believe, as the other day I couldn't remember the page name so typed WP:MAGIC in search and ended up here instead. Thanks! StephenBuxton (talk) 09:26, 22 May 2008 (UTC)
Incorrect links
Searching through here, there are a number of links that aren't quite right, namely the $wg... links. They all link to something along the lines of http://www.mediawiki.org/wiki/Help:$wg..., but it should be .../wiki/Manual:$wg.... For example, the link to $wgVersion is http://www.mediawiki.org/wiki/Help:$wgVersion, but it should be http://www.mediawiki.org/wiki/Manual:$wgVersion (the difference is "Help:" in the first link and "Manual:" in the second). Shouldn't this be fixed? Omega234 (talk) 19:04, 8 June 2008 (UTC)
- Fixed, thanks. JackSchmidt (talk) 03:23, 9 June 2008 (UTC)
Page Names: How can I get the base page name for a subpage?
I am trying to get the magic word that will do the following. Let's say I have page:
TOPPAGE/SUBPAGE
I want the magic word that would bring back just TOPPAGE. It doesn't seem to exist in the documentation. —Preceding unsigned comment added by 76.110.234.160 (talk) 22:41, 28 June 2008 (UTC)
- BASEPAGENAME doesn't do it? Saintrain (talk) 20:51, 6 August 2008 (UTC)
- BASEPAGENAME only removes one subpage level, (e. g. [2], check the "Benutzerseite" link). Something like TOPPAGENAME would be useful when a template may appear at deeper subpage levels. Paradoctor (talk) 09:59, 4 October 2009 (UTC)
- Yes that would be useful. Headbomb {ταλκκοντριβς – WP Physics} 05:57, 22 October 2009 (UTC)
- BASEPAGENAME only removes one subpage level, (e. g. [2], check the "Benutzerseite" link). Something like TOPPAGENAME would be useful when a template may appear at deeper subpage levels. Paradoctor (talk) 09:59, 4 October 2009 (UTC)
Not really a magic word, but you could use a parser function (#titleparts) to acheieve this effect:
This function separates a pagetitle into segments based on slashes, then returns some of those segments as output.
- {{#titleparts: pagename | number of segments to return | first segment to return }}
If the number of segments parameter is not specified, it defaults to "0", which returns all the segments. If the first segment parameter is not specified or is "0", it defaults to "1":
- {{#titleparts: Talk:Foo/bar/baz/quok }} → Talk:Foo/bar/baz/quok
- {{#titleparts: Talk:Foo/bar/baz/quok | 1 }} → Talk:Foo
- {{#titleparts: Talk:Foo/bar/baz/quok | 2 }} → Talk:Foo/bar
- {{#titleparts: Talk:Foo/bar/baz/quok | 2 | 2 }} → bar/baz
For this and more, see the info posted on MediWiki about this. Hope that helps! Avicennasis @ 20:52, 14 April 2010 (UTC)
subst with MWs
Hi! Is there a way to get the functionality of {{subst:PAGESINCATEGORY:cat}}? Thanks. Saintrain (talk) 20:20, 6 August 2008 (UTC)
- Yes! Same syntax. I must have tyoped. Saintrain (talk) 16:42, 7 August 2008 (UTC)
Raising alarms
Where is the table showing the codes to use to raise an alarm, i.e. "This article needs to be expanded on in general", or "this article needs a photo", etc. And yeah, I DO need a response. --Ragemanchoo (talk) 05:47, 19 August 2008 (UTC)
- Excuse me? You catch more flies with honey than vinegar. Toddst1 (talk) 17:36, 20 August 2008 (UTC)
- I've found people on the site to be relatively unresponsive. --Ragemanchoo (talk) 08:11, 21 August 2008 (UTC)
Magic word for current user name
Isn't there a magic word for the current user name?—Largo Plazo (talk) 18:25, 16 October 2008 (UTC)
- apparently not89.34.111.9 (talk) —Preceding undated comment was added at 21:56, 10 November 2008 (UTC).
{{fact}}
I knew what I wanted to insert but I could not remember the magic word for it at the time. I have since found it by checking the source of the article I am editing - the magic word being {{fact}}. Personally I would have expected to find it under the "Wiki markup" section in the drop-down below the editor but for some reason it isn't included there nor is it in the "magic words" article. Is this magic word hidden on purpose from users or what? -Andreas Toth (talk) 00:19, 17 December 2008 (UTC)
substituing REVISIONID
Hi! Is there a way to get the functionality of {{subst:REVISIONID}}? It doesn't work! Thanks. Gustronico (talk) 23:04, 10 March 2009 (UTC)
PAGENAME: piping works
Hi,
I researched & checked (sandbox) that the Magic Word PAGENAME does take piping as expected in this situation:
{{Wikisource1913CatholicEnc|Congo|MyPipeName}}
See (graphic-->):
Worth adding to the Help? (Systematically then, does this work for more (pipeable) Magic Words?). Bye, -DePiep (talk) 13:06, 10 April 2009 (UTC)
How may additional magic words be requests or created?
There are some additional ones I'd like, but I don't know where to find the information on how to do it or where/who to ask. Шизомби (talk) 16:48, 19 December 2009 (UTC)
- It's rare that new magic words do get added; what is it that you need? There may already be some equivalent already in existence. --Redrose64 (talk) 17:23, 19 December 2009 (UTC)
- The technical village pump (WP:VPT), or bugzilla, is probably a place to ask (though it's quite unlikely that anyone will do anything about your request with any speed, or at all).--Kotniski (talk) 11:40, 20 December 2009 (UTC)
Magic Word for article sections?
I wondered if there were magic words similar to {{PAGENAME}} which created the accordant name of the n-th article section (given that it exists), something like {{HEADERNAME1}}, {{HEADERNAME2}}, etc. - If you wonder why i'm asking: i planned to make a TOC with adapted formatting (custom background color, round edges, "Article sections" instead of "Contents") 87.177.180.170 (talk) 23:03, 25 December 2009 (UTC)
- I rather think that a non-standard TOC would be strongly discouraged. --Redrose64 (talk) 17:05, 26 December 2009 (UTC)
Magic Word for removing a page from a category?
I think that I came across this before (how to link to a category but not actually list said article in the category), I am trying to create a template (in my own wiki project) which will both create a box at the top of the page saying it was flagged for deletion and list the page on Template:Delete. I've finished both the template and category, which can be found here. If I could get at least a "this is not possible, get people to [[Category:Delete]] on the page as well as the template," it would be greatly appreciated. Metalmiser (talk) 08:37, 8 March 2010 (UTC)
- To link to a category without putting the current page into the category, put a colon before the word Category, for example: [[:Category:Cities]].--Kotniski (talk) 09:03, 8 March 2010 (UTC)
PAGENAME for pages with underscore
The en:tz database contains identifiers containing an underscore. Templates, e.g.
store data to make it accessible via includes.
Works fine at
But not at
Anyway to replace spaces with underscore?
TimeCurrency (talk) 00:25, 13 March 2010 (UTC)
- Have you tried the magic word urlencode?--Kotniski (talk) 09:17, 13 March 2010 (UTC)
- Try editing Template:Infobox tz to replace
{{PAGENAME}}
with{{PAGENAMEE}}
, which is the URL-encoded equivalent. — Richardguk (talk) 15:20, 13 March 2010 (UTC)
- Try editing Template:Infobox tz to replace
TOC-related Magic Words
Is __NOTOC__ and __TOC__ supposed to work in Userspace? Avicennasis @ 20:52, 14 April 2010 (UTC)