Help talk:Magic words: Difference between revisions
→String Functions: You can't |
Jim Craigie (talk | contribs) |
||
Line 199: | Line 199: | ||
::[[User:Jim Craigie|Jim Craigie]] ([[User talk:Jim Craigie|talk]]) 22:05, 17 December 2011 (UTC) |
::[[User:Jim Craigie|Jim Craigie]] ([[User talk:Jim Craigie|talk]]) 22:05, 17 December 2011 (UTC) |
||
::: You can't. See {{bug|26092}}. The sysadmins are opposed to enabling anything less than some sort of full scripting language (that doesn't use double- and triple-braces all over the place). [[User:Anomie|Anomie]][[User talk:Anomie|⚔]] 04:08, 18 December 2011 (UTC) |
::: You can't. See {{bug|26092}}. The sysadmins are opposed to enabling anything less than some sort of full scripting language (that doesn't use double- and triple-braces all over the place). [[User:Anomie|Anomie]][[User talk:Anomie|⚔]] 04:08, 18 December 2011 (UTC) |
||
::::Thank you for the link to {{bug|26092}}. You have lead me to a battle in {{bug|6455}} that appears to have been going on in a hidden backwater for '''five years!!''' – its very hard to understand. If there is a consensus to add a full scripting language that is not obvious, nor are the timescales for its availability. Even if there is such a consensus and imminent availability, a scripting language would be much harder for non-programmers to use. This looks like [[Perfect is the enemy of good|perfection being the enemy of good]]. Surely no one can believe that the current [[:Category:String manipulation templates|string function hacks]] are better than activating [[mw:Extension:StringFunctions]]. Shouldn't there be a more mainstream location for discussing this? I'm clearly not alone in thinking this. |
|||
::::I am trying to create a template to make URLs for an external site which requires each non-alphanumeric character to be replaced by an underscore, and {{#replace:}} seems to be what I need. I don't want to get embroilled in a protracted battle, so should I just give up trying to improve Wikipedia? |
|||
::::[[User:Jim Craigie|Jim Craigie]] ([[User talk:Jim Craigie|talk]]) 02:22, 20 December 2011 (UTC) |
Revision as of 02:22, 20 December 2011
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).
- Why isn't there any, is there any specific reason for that? If not, I suggest that it is implemented. —Kri (talk) 23:30, 1 July 2011 (UTC)
- I'm bumping this section! —Kri (talk) 23:33, 1 July 2011 (UTC)
- Please don't, per Wikipedia:Talk page guidelines#Technical and format standards the threads should be in chronological order of first creation.
- Such a change is not one which can be incorporated in Wikipedia without an underlying change to the MediaWiki software. You'll need to raise a WP:BUGZILLA ticket, unless you can find an existing one. --Redrose64 (talk) 00:28, 2 July 2011 (UTC)
- I'm bumping this section! —Kri (talk) 23:33, 1 July 2011 (UTC)
- Ok, won't happen again. At least not until I've raised a WP:BUGZILLA ticket ;)
- By the way, I think the template Currentuser does what we're looking for, the correct usage should be {{subst:Currentuser}} if you want the username to stick. —Kri (talk) 01:22, 2 July 2011 (UTC)
- It depends upon how you want to use it. Using
{{subst:currentuser}}
is exactly equivalent to using{{subst:REVISIONUSER}}
. It follows that this is the name of the person who added that text, and not the name of the person currently viewing the page, which is what I believe the original poster was asking for. So, if you want to create an automatic personalised message which changes for each person viewing it, it's not presently possible. --Redrose64 (talk) 11:22, 2 July 2011 (UTC)
- It depends upon how you want to use it. Using
- By the way, I think the template Currentuser does what we're looking for, the correct usage should be {{subst:Currentuser}} if you want the username to stick. —Kri (talk) 01:22, 2 July 2011 (UTC)
- Okay, if you want the name of the person that is viewing the text, since currentuser apparently has to be substituted, I guess
{{REVISIONUSER}}
is the thing you want to use? Test: Jim Craigie —Kri (talk) 12:22, 2 July 2011 (UTC)
- Okay, if you want the name of the person that is viewing the text, since currentuser apparently has to be substituted, I guess
- There isn't a magic word for the username of the user currently viewing the page because that would destroy the caching and overload the servers, and it's completely useless except for novelty on user pages (i.e. "Hi, VisitorName! Welcome to my user page!"). Anomie⚔ 15:00, 2 July 2011 (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)
- {{fact}} is a template, not a magic word. —Lowellian (reply) 22:14, 21 May 2010 (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
But they make both +, not _, instead of spaces. How could I make a link with underscores and special characters? 193.71.127.134 (talk) 18:26, 24 May 2010 (UTC)
- "
{{PAGENAMEE:America/Santa_Isabel}}
" (and "{{PAGENAMEE:America/Santa Isabel}}
" too) produces "America/Santa_Isabel", with an underscore. America/Santa_Isabel looks OK to me; what exactly is the problem? — Richardguk (talk) 21:15, 24 May 2010 (UTC)
TOC-related Magic Words
NOTOC and TOC in User Space?
Is __NOTOC__ and __TOC__ supposed to work in Userspace? Avicennasis @ 20:52, 14 April 2010 (UTC)
- I don't see why not. Do you have an example where they don't work?--Kotniski (talk) 05:57, 15 April 2010 (UTC)
Yep. I want to suppress the TOC on my todo list, and it isn't working. User:Avicennasis/todo. :-/ Avicennasis @ 21:17, 15 April 2010 (UTC)- Nevermind. Turns out one of the templates I was transcluding had it built in. >.> I fixed it. Avicennasis @ 21:29, 15 April 2010 (UTC)
Magic Word to Autohide TOC
I have seen wiki pages in the past that opened with an automatically hidden TOC with the Show button next to it... I cannot find them now. Can anyone tell me how this is done?
Nerdvana (talk) 22:14, 8 October 2010 (UTC)
- Not a magic word, but a template -
{{TOChidden}}
. --Redrose64 (talk) 15:41, 9 October 2010 (UTC)- Excellent. Is that a part of MediaWiki or will I need to ask the admin of the wiki I'm working in to port that over? --Nerdvana (talk) 16:41, 9 October 2010 (UTC)
- It's a template, therefore is not part of the MediaWiki standard installation. Since it's a template, if it doesn't already exist on the relevant Wikipedia language, you should be able to create it. AFAIK it's only on two other languages: id:Templat:TOChidden and pl:Szablon:Spis treści zwinięty although I'm suspicious about the Polish one. --Redrose64 (talk) 17:59, 9 October 2010 (UTC)
- Excellent. Is that a part of MediaWiki or will I need to ask the admin of the wiki I'm working in to port that over? --Nerdvana (talk) 16:41, 9 October 2010 (UTC)
Suggestion {{{n}}}
Add {{{value}}} magic word. SWFlash
- Please clarify your request. First: why? Second: what will it do? Third: why would it have triple braces? Triple braces are normally for template parameters; magic words usually use double braces. --Redrose64 (talk) 20:17, 30 November 2010 (UTC)
Where is #tag documentation
I couldn't find #tag listed in the table along with #if, #ifeq, etc. Where is it documented? —Preceding unsigned comment added by 64.129.229.106 (talk) 23:30, 8 December 2010 (UTC)
- mw:Help:Magic words, as mentioned at the top of the help page. Anomie⚔ 02:11, 9 December 2010 (UTC)
unpadding
I'm looking for a template that will eliminate padding (ie the negation of padleft/padright). I'm working on an extension to template:binary for decimals, and I keep running across this issue. Any help (even how to search for such a thing) would be greatly appreciated. VIWS talk 05:37, 21 July 2011 (UTC)
I made it work without, but I'd still like to know if there is such a thing, and if not, put it on someone's list. VIWS talk 09:22, 25 July 2011 (UTC)
NOEDITSECTION
__NOEDITSECTION__ doesn't seem to be working, see Portal:Contents for example. Has it been disabled ? Mattg82 (talk) 18:20, 14 December 2011 (UTC)
- I see it was also mentioned on Village pump. Also see Template:Bug and Template:Bug, they say resolved but still doesn't seem to be working. Mattg82 (talk) 18:47, 14 December 2011 (UTC)
String Functions
Why don't the mw:Extension:StringFunctions, e.g. {{#len:string}} work here?
Jim Craigie (talk) 06:35, 17 December 2011 (UTC)
- Because they're not enabled on this wiki. See the third "Note:" box. --Redrose64 (talk) 14:03, 17 December 2011 (UTC)
- Well, thank you, but how can I get them enabled here?? Unless I've misunderstood, LocalSettings.php doesn't appear to be something that I can change myself.
- Jim Craigie (talk) 22:05, 17 December 2011 (UTC)
- You can't. See Template:Bug. The sysadmins are opposed to enabling anything less than some sort of full scripting language (that doesn't use double- and triple-braces all over the place). Anomie⚔ 04:08, 18 December 2011 (UTC)
- Jim Craigie (talk) 22:05, 17 December 2011 (UTC)
- Thank you for the link to Template:Bug. You have lead me to a battle in Template:Bug that appears to have been going on in a hidden backwater for five years!! – its very hard to understand. If there is a consensus to add a full scripting language that is not obvious, nor are the timescales for its availability. Even if there is such a consensus and imminent availability, a scripting language would be much harder for non-programmers to use. This looks like perfection being the enemy of good. Surely no one can believe that the current string function hacks are better than activating mw:Extension:StringFunctions. Shouldn't there be a more mainstream location for discussing this? I'm clearly not alone in thinking this.
- I am trying to create a template to make URLs for an external site which requires each non-alphanumeric character to be replaced by an underscore, and {{#replace:}} seems to be what I need. I don't want to get embroilled in a protracted battle, so should I just give up trying to improve Wikipedia?