User:Bmusician/Adoption/Gtwfan52
![]() | This user subpage is currently inactive and is retained for historical reference. If you want to revive discussion regarding the subject, you might try contacting the user in question or seeking broader input via a forum such as the village pump. |
== Gtwfan52 (talk · contribs) ==
First Assignment: The Five Pillars - Completed
|
---|
What are the five pillars?[edit]The "five pillars" are the fundamental principles by which Wikipedia operates.
The Core Content Policies[edit]The core content policies on Wikipedia are neutral point of view, no original research, and verifiablity. Editing from a neutral point of view (often abbreviated as "NPOV") is required on Wikipedia. Editing from a neutral point of view means representing unbiased and significant views that have been published by reliable sources, and giving due weight to all points of view. All information on Wikipedia must be verifiable - so any information unsupported by a reliable source does not belong here. The personal experience or opinion of an editor also does not belong to Wikipedia. Reliable sources[edit]Wikipedia uses the word source for three interchangeable ideas – a piece of work, the work's creator or the work's publisher. In general, you would expect a reliable source to be published materials with a reliable publication process, authors who are regarded as authoritative in relation to the subject, or both. This doesn't mean that a source that is reliable on one topic is reliable on every topic, it must be regarded as authoritative in that topic – so whilst "Airfix monthly" may be a good source on the first model aeroplane, I would not expect it to be authoritative on their full size equivalent. A source that is self-published is in general not considered reliable, unless it is published by a recognized expert in the field. This means that anything in a forum or a blog and even most websites are considered unreliable. One interesting sidepoint is on self-published sources talking about themselves. Obviously, a source talking about itself is going to be authoritative, but be careful that the source is not too self-serving – the article really should not be totally based on a direct source like that. Mainstream news sources are generally considered reliable, but any single article should be assessed on a case by case basis. Some news organizations have been known to check their information on Wikipedia – so be careful not to get into a cyclic sourcing issue! There's a lot more about what makes a source reliable here. Discussion[edit]If there are any questions you have about this lesson, ask away: otherwise, answer the three basic questions below. Questions[edit]Please note that short yes/no answers are not acceptable. 1. Your best friend says that the Diary of a Wimpy Kid film "is the stupidest and most boring movie ever". Can you add this to the article and why?
2. A blog titled "John Doe Fan Blog" states that John Doe will be going to Hong Kong on 7 July. No other source states that this is true. Can you add this to Wikipedia, and why?
3. Is the official Facebook page of KFC a reliable source?
Your answers to 1 and 3 were great, but your answer to #2 I felt was inadequate - I've written a follow up question to it. Bmusician 00:20, 27 April 2012 (UTC) |
Second Assignment: Wikiquette - Completed
| |
---|---|
What is wikiquette?[edit]Wikiquette basically means "wiki ettiquette", and is the etiquette of Wikipedia. I'm just going to highlight some of the important Wikiquette items that you should try and remember. It may help you out.
Discussion[edit]Any questions? This assignment is pretty simple and so there are no additional questions that you have to answer. Please acknowledge that you are done reading the lesson so we can move on to the next assignment. Wikiquette? check! next, please?Gtwfan52 (talk) 05:14, 27 April 2012 (UTC) |
Third Assignment: Copyright - Completed
| |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
This is probably the most important assignment I'll give, because this is the only one where failure to adhere exactly according to policy will result in an indefinite block from editing the encyclopedia – pay attention. Glossary[edit]There are a lot of terms associated with copyright. Here is a glossary of the terms.
CC-BY-SA and GFDL[edit]On Wikipedia, you can only include text which has been released under CC-BY-SA and the GFDL. In fact, if you notice, every time when you edit, the following text is underneath the editing window:
So you are in effect contributing every time you edit. Now, let's think about that non-free content criteria - "No free equivalent" means that you will never be able to license text under it (except for quoting) - as you can re-write it in your own words to create an equivalent. You always, always, always have to write things in your own words or make it VERY clear that you are not. Image Copyright on Wikipedia[edit]Copyright is a serious problem on a free encyclopedia. As I said before, any work that is submitted must be released under the CC-BY-SA License and the GFDL. There are two types of images on Wikipedia, free images and non-free images. Free images are those which can be freely used anywhere on Wikipedia. A free image may be either public domain, or released under a free license, such as CC-BY-SA. Free images can be used in any article where their presence would add value. As long as there is a consensus among the editors working on an article that the image is appropriate for the article, it's safe to say that it can remain in an article. Free images can even be modified and used elsewhere. Non-free images, however, are subject to restrictions. Album covers and TV screenshots are two types of images that are typically non-free. They may belong to a person or organization who has not agreed to release them freely to the public, and there may be restrictions on how they are used. You have to meet ALL of the non free content criteria in order to use them. What is fair use?[edit]![]()
Only when an image meets all of these criteria may it be used. Fair use images must be used in at least one article (not "orphaned"), and articles using fair use images must use as few of them as possible. Any image that does not meet these criteria to the letter will be deleted. Any user that repeatedly uploads images not meeting these criteria to the letter will be blocked. As a further note, I mentioned that fair use images must not be able to be replaced by a free alternative. What this basically means is, there is no way you, me, or anyone else could go out and take a picture of this same thing and release it under a free license. For example:
When people refer to Commons on Wikipedia, they're generally referring to Wikimedia Commons, a repository of free material. Images on Commons can be linked directly to Wikipedia, like that picture just to the right and above. Now, since Commons is a free repository, fair use is not permitted. It makes sense to upload free images to Commons, so that they can be used by all language encyclopedias. For a full description of the policies and guidelines concerning fair use, read WP:FU. Discussion[edit]If there are any questions you have about this lesson, ask away: otherwise, answer the questions below. Questions[edit]Although copyright on Wikipedia may be a complex topic (lol), please keep in mind that simple yes/no answers are not acceptable.
2. Is Wikipedia really free? Why?
3. Can you upload a press photo of the pianist Lang Lang under a claim of fair use?
4. You find an article about a company that is a direct copy of the About Us page on their website. What would you do?
5. Go to any Wikipedia article and find an image that is used under "fair use". Link to the image in your answer.
|
Fourth Assignment: Deletion Policies and Process - Completed
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Deletion of an article and basically any page occurs when the page would take a fundamental re-write to conform with Wikipedia's accepted criteria for content of the encyclopedia. There are many reasons why a page would be deleted.
Criteria for Speedy Deletion (CSD)[edit]The fastest way a page can be deleted is through speedy deletion. If a page meets at least one or more of the criteria for speedy deletion, it must be tagged for speedy deletion, the creator of the page should be notified, and the page be deleted immediately. Here is a list of all general criteria and important article criteria. For a complete list please view WP:CSD. General criteria[edit]Here is a list of general criteria. The criteria apply to all pages (meaning articles, talk pages, user pages, and even Wikipedia namespace pages.)
Articles[edit]I only have listed the most important article criteria here. These criteria apply only to articles. This means Articles for Creation submissions do not count.
Proposed deletion (PROD)[edit]If a page does not meet the criteria for speedy deletion but you feel that it can be deleted without any controversy, you can propose it for deletion via WP:PROD. To propose an article for deletion, tag the article with {{subst:prod|reason}} and then notify the page creator. There is only one disadvantage to proposed deletion. Anyone, even the page creator, can prevent the proposed deletion by removing the template. If you still believe the article should be deleted if that happens, open an Articles for Deletion debate, which I'll explain about below. If the tag is not removed after seven days, the proposed deletion will expire and so the page will be deleted by an administrator. PROD of unsourced BLP's[edit]A biography of a living person that does not feature any references needs to be proposed for deletion. Do this by tagging the article with {{subst:blpprod}}. Unlike regular PROD the tag can only be removed after there is at least one reference to a reliable source. The page is deleted if the tag is not removed after ten days, or if there are still no references. Deletion discussions (XfD)[edit]
Deletion discussions (XfD, stands for Anything for Deletion) allows Wikipedians to discuss whether an article should be deleted or not. The result of the discussion depends on consensus. Only policy based arguments are considered while the discussion is closed. Deletion discussions are not a vote. Deletion discussions last for seven days, although the duration can be extended if the consensus is not clear after a week; likewise, they can be closed early if a consensus would be clear. The template on the right shows all types of XfD's; the most common is AfD. Discussion[edit]Either ask away or answer the questions below. Questions[edit]1. There is a new page created that says "John Doe is a renowned poet. He lives in Florida." Would the page be applicable for speedy deletion? Why or why not.
2. A page was nominated for deletion. After a week of a discussion, there were one hundred users that !voted for "keep". All of the !votes stated that "The nominator of the page is an idiot!" There were also ten users who !voted for "delete", saying that "this topic fails WP:GNG and lacks coverage in reliable third party sources". What do you think the result of the discussion would be? Why?
3. A newly created page appears to attack John Doe. "John Doe is a big jerk who stomps around all over the place and likes to set people on fire! He has AIDS." What would you do?
4. A newly created article appears to be about a living notable person but has no references. What would you do?
5. A user tags an article for speedy deletion under A1 nearly ten seconds after the page was created. Was their action right, and why?
Cool tools[edit]Tagging CSD and PROD are much easier with Twinkle. Go to WP:TW for instructions on how to install and use it!
|
Fifth Assignment: Dispute resolution - Completed
|
---|
No matter how well you edit Wikipedia, and no matter how simple and obvious your changes may seem, you are very likely to end up in a dispute. This becomes more and more likely as you get into more contentious areas of Wikipedia. The higher the number of page views and the more evocative the subject - the more likely the area is going to be considered contentious. ![]() I'm going to go through the different methods of dispute resolution there are on Wikipedia. They are all covered at the dispute resolution page and the tips there are really worth taking. Simple Resolution[edit]No. I'm not expecting you to back down. You obviously believe what you are saying, and there is nothing wrong with that. What you can do though is attempt to resolve the dispute. How??? I hear you ask. Firstly assume good faith, remember the person you are in a dispute with is also trying to improve the encyclopedia. They are not trying to deliberately damage the encyclopedia. Try to see things from their point of view and see if you can both come to a compromise. Keep calm. There's no urgency to the change you are trying to put in or take out, it will wait until the discussion is complete. If you try to fight by editwarring to keep your preferred version there is a large chance that you will get nowhere and face a block. So, instead follow Bold, Revert, Discuss - one editor makes a Bold edit, which they feel improves the encyclopedia. A second editor Rerverts the edit as they disagree. The two (or more) editors discuss the matter on the talk page until they come to an agreement or proceed along Wikipedia's dispute resolution process. When it comes to the discussion, I want you to try and stay in the top 3 sections of the pyramid to the right. You've heard the phrase "Sarcasm is the lowest form of wit" right? Well, this pyramid explains the different forms of disagreement. Attacks on the character of an editor is never going to help anything. If an editor is "attacking" you, don't respond in kind - stay focused on the editor's argument and respond to that. If you think about what you are saying and how the editor is likely to respond you realise that you have a choice. Your comment will generally go one of two ways, 1): it will address the editors argument and put forward a counterargument which the opposing editor will be able to understand, and 2): It will not address the situation, thereby infuriating the other editor and escalating the drama. Accusations of attacks, bad faith, ownership, vandalism or any number of negative suggestions are going to fall into (2). If there are issues with one of these problems, follow Wikipedia's dispute resolution process and try to keep a cool head. If needs be, walk away and have a cup of tea. Play a game of "racketball". Whatever you do to calm down and just not be on Wikipedia. Wikipedia dispute resolution process[edit]If the simple techniques don't work (and you'd be amazed how often they do, if you try them), Wikipedia does have some methods of dispute resolution Assistance[edit]If you want someone to talk to but not necessarily step in, there is an WP:Editor Assistance notice board. The editors there are experienced and can offer suggestions about how to resolve the situation. Third opinion[edit]You can get someone uninvolved to step in and give an opinion on a content dispute. WP:3O has instructions on how to request a third editor to come in and discuss the situation. Another option to get a third opinion is to go to the project noticeboard associated with the article to ask for an opinion (the talk page lists which projects are associated with the article). Finally, you could leave a message at a relevant noticeboard - WP:SEEKHELP Mediation[edit]If the issue won't go away, even after a couple of people have weighed in, you can try Mediation. There are two processes here. Informal (WP:MEDCAB) and formal (WP:RfM). There's also WP:DRN which is fairly informal but focuses more on content disputes. The editors involved with all of these processes specialise in resolving disputes. Request for Comment[edit]You can use WP:RfC to draw community discussion to the page. You are likely to get a larger section of the community here than a 3O request. There is also an option to Request comment on a user. This is rarely necessary and should not be taken lightly. Only after almost every other route of dispute resolution has been taken should this happen - and it requires at least two editors having the same problem with one editor to be certified. Arbitration[edit]I really hope you'll never see this place in a case. It's the last resort, the community has elected its most trusted willing volunteers to preside over the most complicated cases. Have a read of WP:ARBCOM if you like, but try not to end up there. Reports[edit]If an editor is acting badly, there are a few boards where you can get some help. Remember: you could be wrong![edit]You could be acting against consensus! But as long as you are open to the possibility and have been sticking the top 3 sections of the pyramid, there's nothing wrong with disagreeing. Just make sure you are aware that at some point you might have to realise you are flogging a dead horse. Discussion[edit]If you have any questions, ask them now! Or answer the questions below. Questions[edit]1: What does bold, revert, discuss mean to you?
2: Assuming that person A puts in an edit, person B reverts, person A reverts... and so on, but both stop short of WP:3RR (the bright line)... who wins the edit war? Trick question alert!
3: What is vandalism?
4) What is the difference between editor assistance, third opinion and request for comment?
|
Sixth Assignment: Vandalism - Completed
|
---|
What we're going to do now is get you started with some basic vandalism patrols. This is by no means something you will be obligated to do as an editor, however it is something you should know how to do due to the high risk of vandalism on Wikipedia. Should you ever become an administrator, you will likely be expected to deal with vandalism in some respect. To start off, let's get some background. Wikipedia is, as you know, a wiki, meaning anyone can edit virtually any page. This is both a blessing and a curse, however, as while it does allow a wide range of information to be added and shared, it also allows people with less than benevolent intentions to come in and mess around with stuff. It requires a fair amount of work during every hour of every day to ensure that this vandalism does not run rampant and destroy the project. Fortunately, with a near-endless supply of volunteers across the world, this doesn't really cause a problem. The addition of various tools help aid our cause and make the "reversion", or removal, of vandalism happen within minutes (sometimes seconds). What is vandalism?[edit]What we define vandalism as is "an edit which is delibrately attempting to harm the encyclopedia" to an article or other page. Most commonly, these are pretty blatant - replacing a whole page or section with curse words, simply removing entire sections, and so forth. Occasionally, it's less obvious, like changing key words in a section to completely alter the meaning. Basically, anything that can't be helpful at all to the article should be considered vandalism, however you should always remember to assume good faith for questionable cases. The most commonly used, and arguably the most critical tool in this respect, is Special:RecentChanges. Recent Changes is a special page that lists every edit made across the project within the last few minutes. You can find a link to it in the toolbar to the left. The page is formatted similarly to a page's history, with a few differences. Here's how a standard entry generally looks:
So that you can know all the terminology (which in some cases will be used across the site), I'm going to explain what all of this means. Feel free to skip this if you've already clicked the links.
Now that you know how to use Recent Changes, I want you to and find some vandalism edits. I don't want you to remove the edit yourself just yet - we'll get to this shortly and chances are, another editor or bot will beat you to it. So before you go on, go to Special:RecentChanges and find three vandalism edits. So that I can check your work and we can discuss things, I want you to copy the links to the diffs of these three edits into the brackets you see below. (This is most easily done by copying the URL from your address bar while you're viewing the diff.) IMPORTANT WARNING[edit]IMPORTANT WARNING: Due to the very nature of vandalism on Wikipedia, it is possible you will encounter something that will offend you. I take this time to point out Wikipedia's Content Disclaimer, which basically says that you can find just about anything on here and it's not WP's fault. While you may find something offensive in your searches and subsequent vandal patrols, it is best to simply brush it off and not take it to heart. Later on, when you are actually reverting vandalism, it is possible that your own user pages will be vandalized. Here the same thing applies - ignore and simply remove it. I do not tell these things to scare you, or to imply that it will happen. I am simply pointing out that it is possible, although exceedingly rare. In many cases, these attempts to attack you are in fact somewhat amusing. If it occurs, just remember how intellectually superior you clearly are to the vandal and be glad that you actually have a life. Please add your signature here (~~~~) to confirm that you have read and understand this warning: Gtwfan52 (talk) 19:13, 5 May 2012 (UTC) Task[edit]Now that that's over with, go do your task. Have fun! (By the way, please ignore new pages, indicated by a bold "N" on the log entry.)
How to Revert[edit]Well, if you're using anything but Internet Explorer 8 and below, I suggest using Twinkle. You can turn it on by going to My Preferences --> Gadgets --> Twinkle. saving your preferences and then holding shift while pressing the refresh button. Suddenly you have new things to play with! Each diff gives you 3 options to roll back - more can be found at WP:TWINKLE Vandalism and warnings[edit]You occasionally get the repeat vandal. The vandal who is here, not because he is bored and has nothing better to do, but because he has a singular purpose of wreaking as much havoc as he can before he gets blocked. These vandals go in and remove entire sections of text, or replace entire pages with gibberish repeatedly. Even after you've given them a warning, they ignore it and continue. It is for these vandals we have multiple levels of warnings. In general, you will escalate up those levels from 1 to 4 as the vandalism continues. If it's nothing clearly malicious (see below), you should always assume that it was a careless mistake (in short, assume good faith, one of Wikipedia's foundation principles), and just let them know that you fixed it. As it continues, it becomes more and more obvious that they intend to cause trouble, so the warnings get more and more stern. Occasionally, you'll get the vandal, who despite all logical reasoning, continues to vandalize after that final warning. When this happens, we have no choice left but to block them. Since we're not administrators, we lack this ability, so we must report them to those with that power at Administrator intervention against vandalism. That page provides complete instructions on how to file a proper report. If you are using Twinkle, you can report a user to this page by clicking the "arv" tab at the top of any of their user pages. Usually, an administrator will take action within minutes, but until that happens, you need to continue watching the vandal's contributions and reverting any further vandalism. The Three-Revert Rule does not apply when dealing with obvious vandals. I should also note here that many vandals will remove warning template from their talk page. While this may appear as vandalism, and for a time was treated as such, it is not necessary to re-add these warnings, and no warning should be issued for the blanking of the talk page. While these templates do serve as an easily accessible record for other vandal fighters, their main purpose is to alert the vandal to the consequences of their actions. Removing the templates is considered a way to acknowledge that they have been read. Then you get the belligerent vandal. This is very similar to the last kind, although they actually take the time to read the warnings (or are able to) and take offense. They go by the logic that anyone can edit Wikipedia, so who are you to tell them that they can't edit in this particular way? To make this rather annoying point, they will leave an offensive message on your talk page, or more often simply add some sort of vandalism to your main user page, which you generally won't notice for several more minutes, or days, if someone else reverts it first. When this happens, you just have to take it in stride, and remember that you are far more intelligent than them because you actually stop to read information instead of blanking it away, and thus the human race still has some hope for salvation. Just revert it, and slap them a {{uw-npa}} warning of whatever severity you deem necessary. The last version got a {{uw-npa4im}} warning, an "only warning" for the most severe offenses, and I still reported him straight off anyway. The final version is the malicious vandal. These are hardest to notice, because their edits aren't immediately recognizable. They will seem to be improving the article at first glance, when really they're replacing true information with false, often libelous parodies. Others replace valid links with shock sites, or add hidden comments with offensive information. This last version doesn't actually appear in the article, but is there waiting when someone comes to edit it. A similar type of vandal, the "on wheels" vandal, is here for the sole purpose of destroying the encyclopedia. The namesake, User:Willy on Wheels, replaced dozens of pages with the text "{{BASEPAGENAME}} has been vandalized by User:Willy on Wheels!" The BASEPAGENAME variable is a magic word that displays the name of the page. After his blocking, Willy continued to create hundreds of sockpuppets for the same purpose. This sort of vandal is clearly here to vandalize, as such actions are not accidental. With them, you can safely assume bad faith right from the start and slam them with a more severe warning. No, you don't have to escalate in all cases - if there is no doubt that the edit was made with bad intentions, you may start with a higher level than normal. The "4im" level is designed specifically for cases of severe vandalism, and is an only warning to cease and desist. Keep an eye out for all of these vandals, and keep that information in mind when stopping them. There is a full customized range of warning templates to be found at WP:UTM - use the most specific one possible, so that the vandal, if he did make a simple mistake, has the links at hand to learn from his mistake and improve. Any questions, please put them on the adoption talk page. Discussion[edit]Any questions? Or would you like to answer the questions below? Questions[edit]1. What is vandalism?
2. We currently have four levels of warnings, have a look at them if you like 1, 2, 3, 4 - along with an only warning. Do you think we need 4 levels?
3. Does an admin need all 4 levels to block? How many do you think they need? How many should you have gone through before going to AIV?
4. When do you think you might use the "only" warning?
5. Is a copyright violation vandalism?
6. The vast majority of vandalism comes from IP editors... but the majority of good edits are also made by IP editors. Should Wikipedia require registration?
7. Have you finished the task above, in the "IMPORTANT WARNING" section?
|
Final Assignment: Working on Wikipedia - Completed and Passed Exam
|
---|
Welcome to your final assignment! Great job for getting this far. This assignment is designed to teach you about the different areas you can work. It's a big wide encyclopedia out there. Building[edit]The first option is to build new articles. You know an awful lot about how Wikipedia works now, what's notable and what's not, and what are reliable sources and what are not. How about you try and write an article? Something new, something different. You may have already done this. If you can write 1500 characters about a subject, you can submit it for Did you know (DYK). Did you know is a great way to ensure your new articles are up to scratch (they need to be less than 5 days old in the mainspace, well sourced and have a catchy "hook") and the hook should appear on the front page in the Did you know section! You can also apply for a DYK if you expand the characters in an article by 5x. That can be quite tough, but it is possible. Join a WikiProject[edit]Have a look at your favorite articles. On the talk page, you'll often find that they have an associated WikiProject. The project is always looking for new members and will enjoy your help! They often have to-do lists and you could help out. :) Deleting[edit]Why not mozy over to WP:XfD? There's always debates going on about articles that might need deleting from the encyclopedia. Throw in a view! You've been reading so much theory, you'll know as much as most people. There's an page on arguments you should avoid in deletion discussions which might help you. List of areas[edit]There's a lot to maintain at wikipedia, and your help would be gratefully received.
Help the encyclopedia move forward[edit]There's always discussions going on at requested moves and RfC. Why not see if you can offer a point of view? The most important (supposedly) at any given time are listed at WP:CENT. Hey, you can even wander around the village pump (the encyclopedic version of the water cooler) and see if there's any general discussions you're interested in. Discussion[edit]Think there's stuff there you can do? Are you ready for the final exam? I have to warn you, some of these will be involved in the practical test... oh yes, there's a practical test. If you're ready for the exam, please let me know, and I'll provide you with a link to it! :) |
Sixth Assignment: Templates
[edit]Templates allow you to post large sections of text or complicated sections of code while only typing a few characters. Templates work similar to regular links, but instead of [[double square brackets]], you use {{curly braces}}. To call a template, just type the title of the template between the double braces. You don't need to include the "Template:" prefix; the MediaWiki software automatically searches within the Template namespace for what you're looking for. Only if the page you're looking for is in a different namespace do you need to specify it. See below:
What I type | What appears | Comments | ||
---|---|---|---|---|
{{user en}} |
|
This calls Template:User en. All content there (that is marked to be included, see below) appears where I type the template code. | ||
{{Bmusician}} | {{Bmusician}}
|
I get a red link because no page exists at Template:Bmusician. | ||
{{User:Saoshyant/Userboxes/User oops}} |
|
When I specify the User: namespace, the userbox I have at that location appears. Thus, a template does not have to be in the Template: namespace to work. | ||
{{User DYK}} |
|
I get a {{{1}}} where a number should appear. This is due to the fact that I did not specify a parameter in that template. |
One template you can use to welcome new users, Template:W-basic, has several parameters which can customize its appearance. Most of those parameters are named, in that you have to specify to the template what the name of the parameter is when you use it. {{w-basic|anon=true}} sets the parameter "anon" to "true", which generates a message directed towards anonymous users. The advantage to named parameters is that they can be placed in any order, but they must be spelled exactly right or they will not work. The template also uses an unnamed parameter, one which does not have to be specified when it is put into use. Templates automatically assign a numerical name to unnamed parameters when they are used, starting with "1". {{w-basic|message}} sets the unnamed parameter "1" to "message", which is what that parameter is used for in that template. The userbox above can specify the number of states visited with that same unnamed parameter. Unnamed parameters must be in sequential order to work properly, unless you force them to be out of order by using syntax such as {{template|2=foo|1=bar}}. Using "1=, 2=" is also required if the parameter has a = anywhere within (occasionally the case with some external links).
When writing templates, there are some extra tags and codes that have special effects when a template is called.
Code | What it does |
---|---|
{{{1}}} | Causes a parameter "1" to display at that location. |
{{{name}}} | Causes a parameter "name" to display at that location. (Calling the template {{Template|name=Worm}} will cause "Worm" to display at that location) |
{{{1|foo}}} | Sets a default value "foo" for parameter "1", which prevents the parameter from displaying as it does in the userbox above. This can be blank: {{{1|}}} |
<includeonly>foo</includeonly> | Causes the text "foo" to only appear when the template is called. It will not appear on the template page, or in previews when editing the template. As a result, any code included in these tags will not be executed until the template is called. |
<noinclude>foo</noinclude> | Removes the text "foo" from the template. Documentation (notes on how to use a template) is always included with these tags so that it is not called along with the template. |
{{{1|lorem ipsum}}} <noinclude>dolor sit amet</noinclude> <includeonly>etc...</includeonly> | When this template is called, it will display parameter 1 first, followed by "etc...". If parameter 1 is not defined, the template will display "lorem ipsum etc..." |
Conditional templates allow for use of more intricate templates, with optional parameters or different effects depending on what a certain parameter is set to. They use parser functions such as #if: to apply certain conditions to the code. Use of these functions can allow you to create some rather advanced templates, but often get exceedingly complicated and should only be edited by those users who fully understand how they work. Since these are rather complex, they will not be covered in your exam, but if you'd like we can cover them after we've completed the other topics.
I forgot to mention - there are two ways to call a template. Transclusion is simply calling the template as I showed you above: {{template}}. This displays the template where you put the call for it, but leaves the curly braced call in place so that it's easy to remove. This also causes the template to update every time the page is loaded, if it has been edited or has a time-sensitive variable. Substitution, or "subst'ing" a template, causes the opposite effect. To substitute a template, add the code "subst:" at the beginning of the call: {{subst:template}}. When this is done, you are seeing the curly-braced call for the last time, because when you save the page, the MediaWiki software will replace that call with the template's code. This causes the template to lock in place - however it was when you called it, is how it's going to be from then on. This makes things a little difficult to remove, though, as instead of the simple template call, you've probably got lines of code that are now clogging up your article. Depending on how the template it written, it may require subst'ing to work properly, or it may require that it is not subst'ed. The page at WP:SUBST gives details on what templates should, must, or must not be substituted. When writing templates, it can also be useful to enclose the subst: code within <includeonly> tags. See below.
Code | Displays | Comments |
---|---|---|
{{CURRENTTIME}} | 14:11 | Template is transcluded, so updates every time you load the page. |
{{subst:CURRENTTIME}} | 22:56 | Template is substituted, so is stuck on the time I saved this page. |
{{<includeonly>subst:</includeonly>CURRENTTIME}} | 09:27 | Here, the template acts as though it were transcluded on the source page of this lesson, User:Bmusician/Adoption/Assignments/Templates. However, it was substituted when I placed this lesson on the main adoption page, and so is stuck at the time shown. |
This lesson should show you how templates can be really useful for a lot of things. However, we can make templates even more functional and more powerful by having them do different things depending on what the parameters we set are. For more information on that, see the optional lesson on advanced templates.
Discussion
[edit]Any questions or would you like to take the test?
Advanced Templates
[edit]Note: You should complete the previous lesson on templates before taking this lesson.
In the previous template lesson, you saw how you could use template parameters to add custom information into a template message. In this lesson, we'll look at how to use other templates to make even more happen, depending on what you enter as a parameter. These other templates are called "ParserFunctions" and are built into the MediaWiki software that Wikipedia is based on. Because of that, you can't edit these templates by going to their template page (because there isn't one), and they also are called in a unique way.
Before we look at these, let's have a quick review of how parameters work, because many of these ParserFunctions are going to depend on them, and you using them correctly. You create a parameter by using three curly brackets around a name (or number), like so: {{{foo}}}. In that case, calling the template "example" would require you to use a "foo" parameter, like this: {{example|foo=bar}}. That will cause the word "bar" to appear wherever you have the code "{{{foo}}}" in the template. If you forget the parameter, though, (just using {{example}}), bad things happen. Instead of a useful word, you get a big ugly {{{foo}}} in the middle of your message. We can avoid this by giving "foo" a default value with a pipe character: {{{foo|Hey, dummy, you forgot to set "foo".}}} Now, instead of an ugly parameter, we get a helpful message that tells us exactly what went wrong and how to fix it. If we'd rather our templates not insult us when we mess up, we can make the default value simply not appear at all: {{{foo|}}}. This works just as well, and in fact is exactly what we want to do for some of the ParserFunctions we're now going to look at.
- #if:
The most basic function we have available is {{#if:}}. #if: probably looks fairly strange to you - since when do we start templates with a # sign? And what's with the colon? That is what tells us, and MediaWiki, that we're calling a ParserFunction instead of a normal template. Here's how #if: works:
{{#if: <text that either is or is not blank> | <what you want to appear if it isn't blank> | <what you want to appear if it is> }}
Huh?
#if: works a little differently than most "if... then..." structures work. #if: is set up like this: "If this space has something in it, I print this. If it's blank, I print that." How does this help us? Well, remember how we could set our parameters to have a blank default value? Imagine what would happen if I wrote this code:
{{#if: {{{1|}}} | Hello! | Goodbye! }}
Now, when I call the template that uses this code, I will do one of two things. I will either enter a parameter or I won't. If I don't, this code will display "Goodbye!" because there is nothing displayed between #if: and the first option; we set our parameter 1 to be blank by default, so there is nothing but blank space for #if: to look at. However, if I do enter a parameter, regardless of what it is, that code will display "Hello!". This is because when #if: looks at what you gave it, there's something between it and the first option. It doesn't care what that something is, it just cares that something exists. But now, here's why we had that short review on parameters:
{{#if: {{{1}}} | Hello! | Goodbye! }}
The difference between these two sets of code is minor, but causes the whole thing to bork up. This time, there is no pipe in our parameter, so there is no default value. As a result, when we don't set the parameter in the template, #if: still sees {{{1}}} right after its colon. So, regardless of what we do, we're always going to get "Hello!" as a result of this function.
- #ifeq:
#ifeq: is a bit more useful. #ifeq: stands for "If equal" - instead of just checking to see if something exists, #ifeq: checks to see if that something is equal to something you specifically told it to look for. Here's how it works:
{{#ifeq: <text you input> | <text you want to compare against> | <what you want to appear if it they match> | <what you want to appear if they don't> }} {{#ifeq: {{{1}}} | foo | Hello! | Goodbye! }}
In the sample above, I want to see if the user typed "foo" as a parameter to my template. If they did, #ifeq: will see that and print out "Hello!". If they enter anything else, though, or in this case, nothing at all, #ifeq: will compare whatever they enter to "foo", see that they don't match, and print "Goodbye!" instead. ( bar =/= foo; {{{1}}} =/= foo ) This code is a bit more "secure" - if you want the template to do something if the user enters "yes" as a parameter, #if: is not what you want to use. If you use #if:, it'll do whatever you told it to do even if the user enters "no". By using #ifeq:, the function will only do this thing if they enter "yes", exactly like that. It won't work even if they enter "YES", because uppercase letters and lowercase letters aren't the same.
But what if you don't want to risk confusing the user? What if you do want "YES" to work? It's pretty pointless to make an #ifeq: for every single different capitalization of "yes". There's two options available to you. One is to use another ParserFunction, which we'll get to shortly, which acts like a super #ifeq:, checking for multiple different parameter values at once. Another, much easier way, is to tell the parameter to use all uppercase or lowercase letters. How? Magic. Observe:
Code | What comes out |
---|---|
{{lc:foo BAR}} | foo bar |
{{uc:foo BAR}} | FOO BAR |
{{lcfirst:BAR foo}} | bAR foo |
{{ucfirst:foo BAR}} | Foo BAR |
You can use these codes (which are examples of some Magic words) on just about anything - including your parameters. Obviously, it won't have much of an effect on {{{1}}}, but when your user types in "YES" when your #ifeq: is expecting to find "yes", adding the code {{lc: {{{1}}} }} will solve all of your problems.
- #switch:
This is my favorite ParserFunction (yes, I'm a geek, and you're not one to talk; you ARE reading this, after all). This is the "super #ifeq:" I mentioned earlier. #switch: allows you to check a single line of text for a practically unlimited number of possible results (That is, the limit is set so high there's no way you're going to design a practical template that uses that many options). It works like this:
{{#switch: <text you input> | <possible value 1> = <what is displayed for possible value 1> | <possible value 2> = <what is displayed for possible value 2> | <possible value 3> | <possible value 4> = <what is displayed for possible values 3 AND 4> | #default = <what appears if the value you input doesn't match any possible value> }}
What this template does is this: It takes the value you enter (which is probably a parameter, which is probably forced to be either lower or upper case for the same reason it would be in #ifeq:) and moves down the list, comparing it to each possible value in turn. As soon as it matches something, it stops, and looks for the next equals sign. It then prints whatever you have between that equals sign and the next pipe. Let's look at an example, based on the above format:
{{#switch: {{lc: {{{1}}} }} | foo = bar | ice = cream | french | burnt = toast }}
If I enter "foo", #switch: replies with "bar". Likewise, "ice" gets "cream" as a response, and "burnt" gets "toast". But "french" also gets "toast". This is because "french" doesn't have anything set specifically for it - there's no equals sign after "french". Because of this, #switch: is going to keep looking for the next equals sign, which is after "burnt". This makes sense for me, because I want that to happen. "burnt toast" and "french toast" both make sense. However, I do have to be careful about what order I put things in; this code may look similar, but will cause "french" to come out with a different result:
{{#switch: {{lc: {{{1}}} }} | foo = bar | french | ice = cream | burnt = toast }}
Now, entering "french" will return "cream", because "ice = cream" is the next value in line for #switch: to find. For both of these, anything not listed in the ParserFunction will not return anything - nothing will be printed, because there is no default value. For #switch: to print something out regardless of what I type in, I would need to specify "#default = <something>" at the very end of the template. There's really no technical reason why #default has to be at the end, but it just makes it easier for other users.
- #time:
Time is an interesting thing in how it is calculated and how it brings some order to our lives. Because of that, it's important we have a bit of code that allows us to display time however we would like. #time: is just that code, allowing you to enter your own custom time and change it however you wish. It's a very useful code, that you'll see used in many places thoughout Wikipedia - for example, proposed deletion templates "expire" after five days, and those templates use a #time: function to control that.
Time, of course, is rather complicated, and #time: itself is complicated to mirror that. Because there are many different ways to display the time, there are many different things you can tell #time: to do. Before we cover that, though, let's look at how #time: works:
{{#time: <how you want the time displayed> | <what time you want displayed> }} OR {{#time: <how you want the current time displayed> }} (to display the time at which the page was viewed)
As you can see, there are two ways to set this code up. You can display the current time, or a custom time that you specify. This custom time can be simply a change in timezone, a certain about of time before or after the current time, or a fixed time that you set. Here are some examples below of how that works. You can ignore the formatting code for just the moment, we'll cover that shortly. Just focus on what I have entered in the time slot on the right hand side.
What I'm doing | Code | Result |
---|---|---|
Printing the current time in UTC | {{#time: H:i:s }} | 14:11:02 |
Changing the time zone to U.S. Eastern Standard Time, during Daylight saving time) (Note that this is in fact backwards: EST is actually UTC-4 during DST.) |
{{#time: H:i:s | +4 }} | 10:11:03 |
Changing the time to 30 minutes ago | {{#time: H:i:s | -30 minutes }} | 13:41:03 |
Fixing the time to the time I saved this version of the lesson | {{#time: H:i:s | {{subst:CURRENTTIMESTAMP}} }} | 15:51:32 |
Fixing the time to 30 minutes before I saved this version of the lesson, in EST during DST (Combining everything you've seen so far) |
{{#time: H:i:s | {{subst:CURRENTTIMESTAMP}} +4 -30 minutes }} | 11:21:32 |
With me so far? You can do almost anything you want with the time that way, but there are some limitations to the template. For example, I was trying to set up a stopwatch here, that would display how many months, days, hours, and minutes had gone by since I saved the code onto the page. This is the code I tried to use: {{#time: n "months," j "days," G "hours, and" i "minutes" | -{{subst:CURRENTTIMESTAMP}} }}. There's nothing wrong with the format, and the time looks as though it might work, but instead I got this: Invalid time.. Obviously not what I wanted. The problem was that I didn't specify any units for it to subtract, and the number {{CURRENTTIMESTAMP}} spits out is way to big to be considered a time zone. #time: is very finicky about what it will accept as a time - it has to be something it can easily recognize and use, or it's not going to bother. Here are some examples:
Code | Result | Notes |
---|---|---|
{{#time: H:i:s | {{CURRENTTIME}} }} | 14:11:00 | {{CURRENTTIME}} converts into a usable value for #time:, specifically the current hour and minute of the day: 14:11 |
{{#time: H:i:s | {{CURRENTHOUR}} }} | Invalid time. | {{CURRENTHOUR}} only returns the current hour, a single number that doesn't mean much of anything to #time:. We know it refers to the hour of the day, but #time: doesn't know if it's the hour, minute, second, or even year. |
{{#time: j M Y | April 9 2008 }} | 9 Apr 2008 | #time: knows how to recognize names of months, as long as they're spelled correctly, so it knows to read that as Month-day-year. |
{{#time: j M Y | 04/09/2008 }} | 9 Apr 2008 | This sort of format is recognizable to me as the same date, but is ambiguous - see below. |
{{#time: j M Y | 09/04/2008 }} | 4 Sep 2008 | This date could also represent April 9th, and some people might expect #time: to display that. Keep in mind that #time: will always read in the order Month-Day-Year if things get confusing. |
{{#time: j M Y | December 7 1941 }} | 7 Dec 1941 | We would expect time to be able to display this properly, but it won't. Computers as we knew them didn't exist in 1941, and this is reflected in how we program things. As far as #time: is concerned, all life began on January 1st, 1970, and you're not going to convince it otherwise. |
{{#time: j M Y | October 14 1066 }} | 14 Oct 1066 | If you try too hard to convince it, #time: will get mad at you and throw a temper tantrum. Don't try it. |
Now that you roughly know how to tell #time: what time to show, let's look at how to get it to show it (following my grammar lesson on antecedants; moving on...). You'll have noticed from above that I've been sticking what seem to be random letters in the format side of #time:. #time: appears to be written for the sole purpose of being confusing as hell, because few of the codes for the format make any sort of sense whatsoever. No, simply typing "day" won't work - if you're lucky, #time: will simply print "day" out and it won't look horrible, but it's also possible you'll get another big red error message. So what does it take? Let's figure it out:
Code | What it shows | Example | Code | What it shows | Example | |
---|---|---|---|---|---|---|
Days and weeks | Years | |||||
W | The number of the week (see ISO week date) | 37 | Y | The year, using four digits | 2024 | |
d | The day of the month, with a leading zero if less than 10 | 11 | y | The year, using two digits | 24 | |
z | The day of the year (January 1 = 0) | 254 | Hours | |||
D | The abbreviation for day of the week | Wed | a | Returns am or pm for use in a 12-hour time format | pm | |
l | The full day of the week (lowercase letter L) | Wednesday | A | Same as above, but uppercase | PM | |
N | The number of the day of the week, ISO style (Monday = 1, Sunday = 7) | 3 | g | The hour of the day, in 12-hour format. | 2 | |
w | The number of the day of the week, US style (Sunday = 0, Saturday = 6) | 3 | h | The hour of the day, in 12-hour format, with a leading zero. | 02 | |
Months | G | The hour of the day, in 24-hour format. | 14 | |||
n | The month number | 9 | H | The hour of the day, in 24-hour format, with a leading zero. | 14 | |
m | The month number with a leading zero (January = 01) | 09 | Minutes and seconds | |||
M | The month's abbreviation | Sep | i | The minute of the hour, with a leading zero. | 11 | |
F | The full month name | September | s | The second of the minute, with a leading zero. | 02 | |
U | The total number of seconds that have passed since January 1, 1970, 00:00:00 UTC. This is used by computers to represent time. | 1726063862 |
Anything that doesn't appear in this list will generally be treated as what it actually is. So, you can wikilink dates by enclosing the format code in square brackets: {{#time: [[F d]] }} produces September 11. If, however, you want to type a letter that is in this list, you'll need to enclose it in quotes: {{#time: U represents a time }} comes out to:
- 1726063862 Wed, 11 Sep 2024 14:11:02 +0000UTCpWed, 11 Sep 2024 14:11:02 +0000UTC02UTC93002 pm 301109UTC
To get the template to display as you intend it to, you'll need to use {{#time: U "represents a time" }} (1726063862 represents a time) or something similar.
Things get easier from here out, don't worry!
- #expr:
This is the last ParserFunction we'll cover, although there are more: this is the last of the more commonly used ones, however. #expr: stands for "expression", referring to the mathematical sort. #expr: is your calculator, allowing you to play with parameters and variables to spit out something that may or may not be useful. It also can be used for logical statements, where 0 is considered false and anything else is considered true. Here's what you can do with it:
Operator | What it does | Sample code | Result |
---|---|---|---|
Mathematical stuff | |||
+ | Adds stuff | {{#expr: 1 + 1 }} | 2 |
{{#expr: 3 + -2 }} | 1 | ||
- | Subtracts stuff | {{#expr: 1 - 1 }} | 0 |
{{#expr: 3 - -2 }} | 5 | ||
* | Multiplies stuff | {{#expr: 3 * 2 }} | 6 |
/ | Divides stuff | {{#expr: 3 / 2 }} | 1.5 |
mod | Finds the remainder after dividing whole numbers. Cuts off any decimal values. |
{{#expr: 3 mod 2 }} | 1 |
{{#expr: 3 mod 2.8 }} | 1 | ||
round | Rounds to the number of decimal places indicated to the right of "round" |
{{#expr: 3.1415926 round 2 }} | 3.14 |
{{#expr: 32345 round -3 }} | 32000 | ||
Logical stuff | |||
not | Changes non-zero to zero, and zero to one. (Makes it not true/false) |
{{#expr: not 30 }} | 0 |
{{#expr: not 0 }} | 1 | ||
and | Only true if both sides are true (non-zero) | {{#expr: 0 and 30 }} | 0 |
{{#expr: 1 and 30 }} | 1 | ||
or | True if one or both sides are true | {{#expr: 0 or 30 }} | 1 |
{{#expr: 0 or 0 }} | 0 | ||
!= | Exclusive or - only true if one side is true | {{#expr: 1 != 0 }} | 1 |
{{#expr: 1 != 1 }} | 0 | ||
= | Equals | {{#expr: 3 = 3 }} | 1 |
<> | Not equal | {{#expr: 3 <> 2 }} | 1 |
> | Greater than | {{#expr: 3 > 2 }} | 1 |
< | Less than | {{#expr: 3 < 2 }} | 0 |
>= | Greater than or equal | {{#expr: 3 >= 2 }} | 1 |
<= | Less than or equal | {{#expr: 3 <= 2 }} | 0 |
You can combine mathematical stuff and logical stuff in the same #expr:, as well as add parentheses to group operations - for example, {{#expr: (30 + 2) / 16 > 3}} will produce 0 ((30 + 2) / 16 = 32 / 16 = 2, which is less than 3, so false or 0). The function follows a specific order of operations, with all things going from left to right:
- Stuff in parentheses ()
- Positive and negative signs (+1, -1, not)
- Multiplication and division (*, /, mod)
- Addition and subtraction (+, -)
- Rounding with round
- Comparisons (=, <>, <, <=, >, >=, !=)
- and
- or
Make sure to be careful about this; just as in school, failing to pay attention to order of operations can easily cause your equation to come out to something you didn't expect.
Obviously there are some things you can't do with #expr: - it doesn't like letters, so using exponential formats such as 6.67E-11, or mathematical constants like e won't work. Also, it's limited by the usual laws of mathematics (for example, you can't divide by zero, etc.)
- Other ParserFunctions
There are a total of 5 other ParserFunctions I haven't covered. I'll list these below, but won't go into detail about them because they are rarely used outside of meta-level templates, such as {{db-meta}}. Each of these is either fairly basic (along with what you already know) or can be easily represented by using one of the functions already covered. If you have an interest in these templates, they, along with the ones mentioned above, are covered in full detail at m:Help:ParserFunctions (Note: this page is on MetaWiki).
- #ifexist: Similar to #if:, this checks to see if a page exists at the given title, and returns one of two possible lines of text.
- #ifexpr: Combines #ifeq: and #expr:, checks a mathematical or logical expression to see if it results in zero, and returns one of two possible lines of text.
- #rel2abs: Converts a relative link to a direct link - for example, /Subpage is a relative link which can be converted to the direct link, User:Bmusician/Adoption/Assignments/Advanced Templates/Subpage.
- #titleparts: Returns a portion of a given page title as specified by the user.
- #iferror: Checks ParserFunctions that could return an error message, including #time:, #expr:, #ifexpr:, and #rel2abs:, and returns a specified line of text if an error is the result.
- Templates and Tables
You've noticed that all of these functions use pipes, just like regular templates do. You've probably also noticed that most templates use tables to keep their formats in a readable order, and that these tables also use pipes. So, how does MediaWiki know when a pipe is a template pipe or a table pipe? Well, it doesn't.
Say you're setting up a template, that displays a table with an optional third row, triggered by the parameter {{{row}}}. Here's the code you try:
{| class="wikitable" |- !This is !a template. |- |This is |a row. {{#if: {{{row|}}} | |- |Here's an |extra row. }} |}
So, let's see what happens when we test this out. We made {{{row}}} be blank by default, so we should see a table that has only two rows.
|
|
Bleah. That's not quite what we wanted. Things came out this way because when we condense the #if: code to a single line, this is what we get: {{#if: {{{row|}}} | |- |Here's an |extra row. }}. #if: doesn't know that it's in a table. #if: just sees that for some reason it's being given four different bits of text to choose from. However, it only cares about the first two: the blank section between the first two pipes, and the dash between the second two. Oops. So how can we tell #if: it's in a table, and needs to ignore some of those pipes? We trick it.
The templates {{!}} {{!!}} and {{!-}} are all designed for this purpose. Since we can't put an actual pipe in there and have it work, we fake it with another template. What happens is that #if: sees the template as a template, that is, like this: {{!}}
. Since that's not a pipe, it assumes that's part of the text you want it to print out. But when it prints that text out into the table, it strips the template down into what it actually is, in this case, a pipe |. Now it's the table's turn. It goes through and sees the code left behind by #if:. Since there's a pipe there now, it deals with it accordingly, and spits out the table as we wanted to see it. So, this is how our code above should be written:
{| class="wikitable" |- !This is !a template. |- |This is |a row. {{#if: {{{row|}}} | {{!}}- <!-- That makes a new row --> {{!}} <!-- That makes a new cell --> Here's an {{!}} <!-- That makes a new cell --> extra row. }} |}
And so we get:
|
|
That's it! Remember, {{!-}} produces |-, {{!}} produces |, and {{!!}} produces ||.
That's everything! Try testing out these templates in a sandbox, and seeing what all they can do. Once you're confident with what they do, feel free to add this userbox to your user page - you'll have earned it! {{User t|3|c}}
{{t|3|c}} | This user contributes to the template namespace with confidence, even with conditional templates. |
Discussion
[edit]As this is an optional assignment, there is no test. But feel free to ask me if you have any questions.