Help talk:Magic words: Difference between revisions
John of Reading (talk | contribs) →Help with magic words in a template: urlencode |
Richardguk (talk | contribs) →Help with magic words in a template: {{urlencode:{{BASEPAGENAME}}}} or {{urlencode:{{PAGENAME}}}} |
||
Line 267: | Line 267: | ||
Hello, i'm a member of [[WP:MMA]] a wikiproject for Mixed Martial Arts. We have been experiencing some troubles with pages being marked for deletion in part because they lack good sources. I thought it might help to build a template that could be dropped in a talk page that would help people find sources. the problem is that the pages in question have spaces in their names, example being [[UFC 49]], the space breaks the external link so the template ends up useless. the magic word i'm using is {{tl|BASEPAGENAME}}, i've tried {{tl|BASEPAGENAMEE}} which replaces the space with an underscore, that makes the link work, but breaks the google search, so again it doen't actually work for what i want it to. When i use the template I've created in a page with no spaces it looks and works great. Anyway, the template i made is {{tl|MMA find sources}}, if you click on that you will see it broken, or you can check out [[User:Kevlar/sandbox|my sandbox]] (the same template, but my sandbox title doesn't have spaces) to see how i hoped it would look and work. Any help is much appreciated! [[User:Kevlar|Kevlar]] ([[User talk:Kevlar|talk]]) 09:19, 5 December 2012 (UTC) |
Hello, i'm a member of [[WP:MMA]] a wikiproject for Mixed Martial Arts. We have been experiencing some troubles with pages being marked for deletion in part because they lack good sources. I thought it might help to build a template that could be dropped in a talk page that would help people find sources. the problem is that the pages in question have spaces in their names, example being [[UFC 49]], the space breaks the external link so the template ends up useless. the magic word i'm using is {{tl|BASEPAGENAME}}, i've tried {{tl|BASEPAGENAMEE}} which replaces the space with an underscore, that makes the link work, but breaks the google search, so again it doen't actually work for what i want it to. When i use the template I've created in a page with no spaces it looks and works great. Anyway, the template i made is {{tl|MMA find sources}}, if you click on that you will see it broken, or you can check out [[User:Kevlar/sandbox|my sandbox]] (the same template, but my sandbox title doesn't have spaces) to see how i hoped it would look and work. Any help is much appreciated! [[User:Kevlar|Kevlar]] ([[User talk:Kevlar|talk]]) 09:19, 5 December 2012 (UTC) |
||
:The template {{tl|Find sources}} uses "urlencode" to get round this, so I suggest you adapt the coding from there. -- [[User:John of Reading|John of Reading]] ([[User talk:John of Reading|talk]]) 11:20, 5 December 2012 (UTC) |
:The template {{tl|Find sources}} uses "urlencode" to get round this, so I suggest you adapt the coding from there. -- [[User:John of Reading|John of Reading]] ([[User talk:John of Reading|talk]]) 11:20, 5 December 2012 (UTC) |
||
: {{Edit conflict}} ''Probably redundant now that John has pointed you to {{Tl|Find sources}}, but in case it's of further help:'' |
|||
: Wrap the page name in {{Tld|[[Help:Magic words#Paths|urlencode]]:...}} to convert spaces to pluses (which Google will convert back to spaces). For example, "<code><nowiki>{{urlencode:{{BASEPAGENAME}}}}</nowiki></code>" produces "{{urlencode:{{BASEPAGENAME}}}}". |
|||
: Note that {{Tld|BASEPAGENAME}} risks removing any part of the article name after a slash (for example, "[[A/B testing]]" would produce "A"). On the other hand, {{Tld|PAGENAME}} risks including extraneous subpages if it is transcluded on talk subpages (such as archive pages). If you will only ever use the template on the main article talk pages, "<code><nowiki>{{urlencode:{{PAGENAME}}}}</nowiki></code>" would be most appropriate. |
|||
: — [[User:Richardguk|Richardguk]] ([[User talk:Richardguk|talk]]) 11:27, 5 December 2012 (UTC) |
Revision as of 11:27, 5 December 2012
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: Richardguk —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)
- I disagree: First, it wouldn't do anything to the cache, as you can see when you're viewing a page, your username is already present if you're logged in. Secondly, I was looking to create polls for the wiki on my site and this would be useful to have. That's just one example, there's far more than novelty involved. — Preceding unsigned comment added by SinisterRainbow (talk • contribs) 07:14, 3 February 2012 (UTC)
- You are wrong about the cache. There are multiple levels of cache employed on Wikipedia, and these are designed so that the different skins, headers, and user scripting included on the page are handled as efficiently as possible while the rendered content of the page is the same (as much as possible).
- As for the wiki on your site, this page is the wrong place to discuss it. This page is about the English Wikipedia. And there is probably already an extension you can install on your own wiki to do what you want. Anomie⚔ 12:12, 3 February 2012 (UTC)
- I disagree: First, it wouldn't do anything to the cache, as you can see when you're viewing a page, your username is already present if you're logged in. Secondly, I was looking to create polls for the wiki on my site and this would be useful to have. That's just one example, there's far more than novelty involved. — Preceding unsigned comment added by SinisterRainbow (talk • contribs) 07:14, 3 February 2012 (UTC)
- The article text is rendered completely differently from the header/footer that shows your current login name, and the bulk of the header is not cached, whereas the article text is. For example, the header can vary wildly by user based on what templates are included. As a workaround in your particular case, you could add some javascript into the header, that did a javascript search and replace on the article text looking for a particular magic word, and replace it. This would obviously only work for users that have javascript enabled, and may have some performance (on the client) impacts. Gaijin42 (talk) 03:16, 20 March 2012 (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?
- Jim Craigie (talk) 02:22, 20 December 2011 (UTC)
- Your best bet is probably to just document that "non-alphanumeric characters must be replaced by an underscore" in the template's documentation. This old VPT thread has a summary of the situation as of mid-2009. At the moment the contender for the "real scripting language" may be mw:Extension:WikiScripts. Anomie⚔ 04:10, 20 December 2011 (UTC)
- Jim Craigie (talk) 02:22, 20 December 2011 (UTC)
No Line
Is there any magic word to remove the horizontal lines which locate after each heading? --Yoosef (talk) 08:20, 9 August 2012 (UTC)
- No, but you can add the following line to either Special:MyPage/common.css or Special:MyPage/skin.css:
h2 { border-bottom: none; }
- This will remove the horizontal line below section headings (those formatted as
==Heading==
). To remove the horizontal line below page headings as well, useh1, h2
instead ofh2
. --Redrose64 (talk) 14:52, 9 August 2012 (UTC)
A quirk
Hi all,
- Over at Wikipedia:Copyright problems there's a section which contains "Wikipedia's current date is {{CURRENTMONTHNAME}} {{CURRENTDAY}}, {{CURRENTYEAR}}...". However, those magic words don't seem to take effect; I just see it rendered as "Wikipedia's current date is CURRENTMONTHNAME CURRENTDAY, CURRENTYEAR. I tried editing the section; after a punctuation tweak it seemd to work in Preview, but on saving the change they're still redlinks. I know that these magic words are used elsewhere successfully (a lot of portals have boxes of "On 05 October..." type content). What's going on? Am I missing something obvious? There are lots of other templates on the affected page so maybe the parser has indigestion? If so, perhaps we should document that weakness more clearly as I couldn't find anything.
- On a related point: Should this help page explain the distinction between magic words and templates, even though both can be invoked with double braces? For instance, if there was a template with the same name as a magic word, presumably it couldn't be invoked in the usual way..? (Whilst trying to figure out what was happening on Wikipedia:Copyright problems I found that there were templates like {{CURRENTMONTHNAME}} which got deleted years ago - they all seem to have been attempts at template vandalism).
Any suggestions? bobrayner (talk) 22:38, 5 October 2012 (UTC)
- The magic words and links at Wikipedia:Copyright problems#Footer are not being processed because the mediawiki processing limits have been exceeded. (If your preferences display hidden categories, you can see that the page has automatically been categorised in Category:Pages where template include size is exceeded.) The cure for this is to remove or "
subst:
" unchanging templates in the preceding sections. - According to mw:Help:Magic words#Variables, if a template clashes with a magic word, the magic word is used and template is ignored. (This can be overridden by specifying "
Template:
" before the template name, but the inevitable confusion makes it better to avoid any duplicate names).
- The magic words and links at Wikipedia:Copyright problems#Footer are not being processed because the mediawiki processing limits have been exceeded. (If your preferences display hidden categories, you can see that the page has automatically been categorised in Category:Pages where template include size is exceeded.) The cure for this is to remove or "
- — Richardguk (talk) 23:23, 5 October 2012 (UTC)
- Groovy; thanks. bobrayner (talk) 01:32, 6 October 2012 (UTC)
Arithmetic operators with magic words
Sorry if this is a stupid question, but I want to be able to use something other than UTC in my sig file, yet I don't want it necessarily to be the time of my computer (I think there's a COMPUTERTIME magic word -- I don't want that). How do I use a math. operator with CURRENTTIME?
Something like the following is what I want to be able to do, but where adding 1 actually works. :)
{{subst:CURRENTTIME+1}} (Berlin Time)
Thanks.
BWP1234 (talk) 11:57, 25 November 2012 (UTC)
- Using the help page here, I constructed
{{subst:#time:H:i, j F Y|now +1 hour}}
which displays as "13:12, 25 November 2012". BUT I'm not convinced this is a good idea, as it will make it hard for other editors to compare your timestamps with those of other editors. -- John of Reading (talk) 12:12, 25 November 2012 (UTC)
Thanks for the quick reply! I'll reflect on the effect on other users before implementing this. (Another ?: Why on earth doesn't Wikimedia default to the ISO date format?= BWP1234 (talk) 12:39, 25 November 2012 (UTC)
- For the same reason that it's discouraged at WP:DATESNO - it's not the natural way of writing dates. --Redrose64 (talk) 14:16, 25 November 2012 (UTC)
- Thanks for the answer, though I (weakly) disagree that it's not the "natural" way of writing dates, but, more importantly, strongly disagree that whatever's natural should be determinate. --User:BWP1234 (talk) 2012-11-25, 14:46 (New York Time)
- There are a number of scripts and bots that expect that dates and times will be written in a particular format. If you try to deviate from that format, stuff like this happens. --Redrose64 (talk) 23:44, 25 November 2012 (UTC)
- Let's hope someone soon realizes that badly written bots need to be scrapped, or rewritten! --User:BWP1234 (talk) 2012-11-26, 02:37 (New York Time)
- Bots are coded to implement an agreed standard. You are welcome to start a discussion about changing the standard to allow for varying time zones, but I, for one, would favour consistency. -- John of Reading (talk) 08:19, 26 November 2012 (UTC)
- Myself, I favor diversity, and everything that enables diversity to flower! --User:BWP1234 (talk) 2012-11-26, 07:44 (New York Time)
- I sympathise with your point that the ISO format would be more logical, but you've even departed from that by using a local timezone instead of UTC.
- More importantly, the adopted signature format has been chosen because it is the single most commonly used and recognised unambiguous international English-language format. So it is not an arbitrary choice. And dozens of bots rely on this standard being followed. In particular, Wikipedia:Signatures indicates that non-standard timestamps can confuse bots which automatically archive sections according the date of the most recent comment.
- You are free to propose a new format, but until community consensus adopts your proposal, the onus is on you to respect the agreed guidelines – or create a more diverse wiki on your own website and edit there instead!
- — Richardguk (talk) 13:27, 26 November 2012 (UTC)
- Here is an example of an ISO format date being wrongly interpreted. There are two possibilities: (i) the person who added the ref had assumed that the format should be CCYY-DD-MM and 158.169.131.14 has applied the correct fix for that; (ii) the person who added the ref had used the format CCYY-MM-DD, but 158.169.131.14 has assumed that it was formatted CCYY-DD-MM and applied the incorrect "fix". In fact it was the latter. This sort of issue will always arise unless we insist upon months being written out as words. --Redrose64 (talk) 13:53, 27 November 2012 (UTC)
- Redrose64: I wouldn't mind writing out the month, but the year should come first: biggest units to smallest units (seconds).
- As for this: "The adopted signature format has been chosen because it is the single most commonly used and recognized unambiguous international English-language format."
- I'm not sure I agree, though I may misunderstand. Though I probably disagree no matter what you mean. Is "international English" a compound noun, modified by the preceding adjectives? If so, I disagree with the application of the adjectives, but mostly with the very idea that there is something that should be regarded as "international English" (though there probably should be some kind of international English -- it would certainly help nonnative speakers!) 2) If "international" is one of the adjectives, then ISO is probably more widely recognized -- or recognizable --(though perhaps not yet most widely used).
- If a condition of my participation here is that I have to conform to a standard I disagree with, I may bow out. Anyway, thanks for the explanations. --User:BWP1234 (talk) 2012-11-27, 12:56 (New York Time)
- Myself, I favor diversity, and everything that enables diversity to flower! --User:BWP1234 (talk) 2012-11-26, 07:44 (New York Time)
- Bots are coded to implement an agreed standard. You are welcome to start a discussion about changing the standard to allow for varying time zones, but I, for one, would favour consistency. -- John of Reading (talk) 08:19, 26 November 2012 (UTC)
- Let's hope someone soon realizes that badly written bots need to be scrapped, or rewritten! --User:BWP1234 (talk) 2012-11-26, 02:37 (New York Time)
- There are a number of scripts and bots that expect that dates and times will be written in a particular format. If you try to deviate from that format, stuff like this happens. --Redrose64 (talk) 23:44, 25 November 2012 (UTC)
- Thanks for the answer, though I (weakly) disagree that it's not the "natural" way of writing dates, but, more importantly, strongly disagree that whatever's natural should be determinate. --User:BWP1234 (talk) 2012-11-25, 14:46 (New York Time)
Help with magic words in a template
Hello, i'm a member of WP:MMA a wikiproject for Mixed Martial Arts. We have been experiencing some troubles with pages being marked for deletion in part because they lack good sources. I thought it might help to build a template that could be dropped in a talk page that would help people find sources. the problem is that the pages in question have spaces in their names, example being UFC 49, the space breaks the external link so the template ends up useless. the magic word i'm using is {{BASEPAGENAME}}, i've tried {{BASEPAGENAMEE}} which replaces the space with an underscore, that makes the link work, but breaks the google search, so again it doen't actually work for what i want it to. When i use the template I've created in a page with no spaces it looks and works great. Anyway, the template i made is {{MMA find sources}}, if you click on that you will see it broken, or you can check out my sandbox (the same template, but my sandbox title doesn't have spaces) to see how i hoped it would look and work. Any help is much appreciated! Kevlar (talk) 09:19, 5 December 2012 (UTC)
- The template {{Find sources}} uses "urlencode" to get round this, so I suggest you adapt the coding from there. -- John of Reading (talk) 11:20, 5 December 2012 (UTC)
- (edit conflict) Probably redundant now that John has pointed you to {{Find sources}}, but in case it's of further help:
- Wrap the page name in
{{urlencode:...}}
to convert spaces to pluses (which Google will convert back to spaces). For example, "{{urlencode:{{BASEPAGENAME}}}}
" produces "Magic+words". - Note that
{{BASEPAGENAME}}
risks removing any part of the article name after a slash (for example, "A/B testing" would produce "A"). On the other hand,{{PAGENAME}}
risks including extraneous subpages if it is transcluded on talk subpages (such as archive pages). If you will only ever use the template on the main article talk pages, "{{urlencode:{{PAGENAME}}}}
" would be most appropriate. - — Richardguk (talk) 11:27, 5 December 2012 (UTC)