text:
Tom Goes to the Mayor

Tom Goes to the Mayor (2004 - 2006) Tom Peters has just moved to the small town of Jefferton, best known for its strip malls, buffet restaurants and run-down parks.

Tom Goes to the Mayor Returns (Pilot) [1.2]
Tom: Well, I just wanna start with uh.. I am not an astronaut. I'm sorry to say.

Mayor: Greaaat!

WWLaserz [1.4]
Mayor: Tom, what you're probably smelling is the cat food, I've been coming by every night to feed you, and since you're unconscious, I would take a dollop of the wet cat food and stick it in your mouth, and then move your jaw up and down, in a chewing motion (Tom gets nauseous).

Tom: I think I have a BM in my pants.

Mayor's nephew: Fill out your menu card and hand it to the nearest veteran.

Pioneer Island [1.5]
Tom: oh brother, my goodness, actually it's been pretty good you know? Joy and the boys have been on vacation, just really freed me up, to work on some of my writing, and it gets a little lonely sure, but you know life thats life. Tom: Oh I'm sorry I thought you been finished by now Tom: Sfew, wow Tom: Awm its Tom Peters Tom: Oh fair enough aw, actually before I get started aw this probably a stupid question but is that island theme park in Jefferton? Tom: Awh hu Tom: Ok we can kinda do pony rides

Porcelain Birds [1.8]

 * Mayor: My sweet chip chips.

Vehicular Manslaughter [1.9]
Mayor and Dr. Ian Black: (doing a weird sort of handshake) Ricka ticka tick tock tick tock tock! Ring! Ringa ding ding ringa ding ding! Ricka dick rick ricka dick rick! Ringa dinga ding ding dong! Rim rim rim rim! Mayor: Michael! How long has it been old friend? Black: Too long, you sassy devil. Mayor: You CRABAPPLE! Black: You delicious horseshoe crab! Mayor: Ohhh I'd grab you with my claws if I had any! Black: I'd pinch you so hard! Mayor: Ohhh... Ooohhhhhh Black: Who's this guy? (Points at Tom) (Tom looks very awkward) Mayor: Oh, shoot that's Torn, Tash, Tennis, Temmes, Tango, Cash, Taaaaay.... Black: He looks like a Steven to me! (Both of them laugh) Mayor: Ahahaha Oooh Steven. Black [overt sarcasm]: Hello, Steven. Tom: Well, actually it's Tom Peters, and it's good to meet you (Extends his hand for Black to shake) (Awkward silence as Black ignores him) Mayor: So Michael, they tell me your a doctor of energy now. Black: Yeah, its a great gig! You are not gonna believe the company car they just gave me. Mayor: Not a Le Baron... Black: A Le Baron!

(They do the handshake again, with Tom looking increasingly awkward.) -- Funputer: Funputer does not recognise the word "who". Did you mean "horsey"? Funputer: sorry my little friend Funputer is running low on disc space "please select a file to delete""please select a file to delete now" Funputer: 'ha ha ha solong my sweet tiny child"

Boy Meets Mayor [1.10]
Mayor: citizens of Jefferton I know what you are thinking of this video, aw hold on can we take a take two on that, citizens of Jefferton I'm sorry for, aw uh thats not working, alright get it together, one, two, come on Jefferton its me. Mayor: Hello Tom Mayor: great come on in Mayor: wow Tom thank goodness let me here them. Mayor: awl Tom you better get that leg up. Mayor: awl no!, why?, why? Mayor: awl Tom what happen to your foot? Mayor: yay but your a mess down their Mayor: mow, mow, mow, oh no Mayor: oh sweet sandel it will be okay, we will get you fixed up i promise. Mayor: emergency! Mayor: hold on a sec whare is that beautiful music coming from? Mayor: wonderful bravo, bravo Mayor: o but he sounds like a winged angel though Mayor: hew what a wonderful shop Mayor: go ahead Tom I'm all ears, ha, ha, ha, get it Mayor: you know the deaf boy, and i said ears ha ha ha ha Mayor: thank you sir, you made them strong i can see that, and i honor you i just wish their was a way to repay you for all the wonderful work you have done here. Mayor: absolutely not Mayor: tsh shhh the sandelman is speaking Mayor: ha ha ha ha ha (crying) Mayor: ladies and gentilmen, if i may i guarantee that team mayor will win this challenge at which point i poromise to give all the prize money to this little sweet boy Shamus so he may become a strong and normal boy. Mayor: Tom! give me some heat, up, up and away. Mayor: bonvagea Mayor: ha ha ha ow ,brang brang brang, ow yeah ha ha Mayor: look Tom the great Jefferton Steeple. Mayor: it is too gorgeous up here ha ha Mayor: aw just smell that fresh air ha ha ha ow wow Mayor: Tom look at it, look at it lap 100 Mayor: come on Tom you dont have to lie about it Mayor: you wanted this mission to fail from the begiening didn't you, Tom? Mayor: i wont do that if i were you Mayor: ewl aw ewl aw pretty, aw pretty clouds awl owww ah Roy? is that you? how could you turn that video in, awl that was something special between you and me ah Mayor: we did it Tom Mayor: looks like the sandelman Mayor: sandelman! Mayor: we are to heavy Tom we got to beat him to the 5000 lap mark, we got to throw Seamus over board Mayor: come on he is dead weight Tom, he hasn't helped out at all, we need to tie some sandbags around his legs to soften the fall Mayor: Tom I'm relieving you of your post, you're know longer fit to captain this ship, come on Tom after me Tom&Mayor: one, two, thrayyyyyyyy Mayor: full stream ahead Mayor: Tom give me your sandal, try this on for size(throwing) Mayor: wow Tom, three cheers to ya, we did it Mayor: no thank you for your great pr work budy Mayor: aw look at him Tom Mayor: aw poor Seamus is going to need a father now I'm really hoping you could step up to that challenge Mayor: Seamus?(dead) Sandalman: Shamus is deaf I'm afraid. Deaf as a door nail!

Calcucorn [1.11]
Tom: Todd shut up!!! Todd: cut, cut, cut Mayor: oh a movie shoot Mayor: I heard this Calcucorn can do your taxes with the press of a button!

Pipe Camp [1.13]

 * Tom: Too much tobacco and sexuality!

 * Mayor: Tom, it's Pipe Camp, live a little!

Rebirth [1.14]
Mayor: Hi I'm the Mayor, Welcome to the department of families lets get you started, please enter your 23 digit family code, followed by the 11 digit confirmation pin.

Mayor: ok, i can't find that number you entered, please make sure the number is correct and try again. or simpley speak your name, now.

Mayor: thank you Tom, I'm seeing that you have step-children, living in your shanTY, your family status has been upgraded to ILLEGAL.

Mayor: we will be holding your wife and step children, in a family holding cell until your wife and basterds are legitament.

Vice Mayor [1.15]
Mayor: It's mayyyyor's niiiight, rim dim dim dim do

Bass Fest [2.2]
Joy: GET MY BOYS TO BASS FEST ..... NOWWWWWWWWWW!!! (room shakes from her thunderous voice)

Tom Peters: To The People Of The Future...Shoot.

Jeffy the Sea Serpent [2.3]
Mayor: I think I liked you better dead Jeffy

White Collarless [2.4]
Elevator: Welcome, CEO Tam Pietress

Wrestling [2.5]
Coach Harris (played by Gary Bucy): I have never seen a more pathetic display of female cowardice and womanly stupidity!!

Coach Harris: Damn it Brendon, what the hell is wrong with you? Have you ever thought about going home and prancing around in your mama's Sunday dress, or wearing her panties, or putting on one of those cotton ponies? You're a sissy bitch, Brendon. Just like your father. Tom: Excuse me, coach? Coach Harris: I've seen your father, I've seen stains in his pants that he can't explain. There's something I like about you, but it isn't being a girl in a boy's body, it's being a WRESTLER!!

Coach Harris: How dare you open your mouth around me. You piece of trash. You worthless excuse for a motherfucking equipment boy. Don't you ever tell me how to coach these boys, or I'll cut off your head and shit in your neck whistle.

Saxman [2.6]
Saxman: Well alright. Tom: Uh Tom Peters here, umm I live around the area. Here bro umm I just want to tell you, your music's wonderful. Saxman: Well thank you brother I think you're wonderful haha. Tom: Hahaha Saxman: Great man Tom: Cool (Thinking In Head: I'd give my left thumb to be this guy's manager). Ah man you must be making a killing out here with these great tunes right bro? Saxman: I'm a little bit done on my luck. To tell you the truth I..you know they kicked me out of house and home because of this damn waterbed galleria. Tom: Uh what do you mean, you live here on the boardwalk? Saxman: Yeah bro it's a real bummer. Tom: Uh that doesn't sound fair. Saxman: A waterbed doesn't anybody who wants a waterbed have one already, that's my take on it. Haha ahh damn. Tom: Ahh well tell you what Saxman, I may have a quick fix uhh my wife is out of town right now visiting her ex-husband, eh shoots she really doesn't like me having men stay over. Saxman: Oh boy Tom': Well uh I can set you up in my son's pup tent you know, for a while umm you know what? I can go ahead and talk to the mayor about getting a relocation plan together I guess. Saxman: Ah that is so sweet man that is so good of you.
 * Tom: Great set man, cool really cool.

 Lou: Hahaha Oh baby I knew you were a waterbed man. Mayor: I certainly am. (Both laugh) Tom: Oh I'm sorry, should've knocked. Mayor: No it's fine Lou is just installing my new waterbed here. Tom: Alright well, I'll just come on back here tomorrow. Lou: Alright get your ass over here and take this bitch for a test drive. Tom: Oops Lou: Easy there. Ok. One two. Tom: That's good thank you. Mayor: It's just like an amusement park ride Tom. Tom: Umm getting a little seasick here. Lou: Hahah Mayor: Ah that was fun. Thanks for stopping by. Tom: Um I'm sorry. I actually have a problem I'd like to discuss. Mayor: Great I love problems Tom: Well um I'm managing a musican here and um he's actually being forced to evacuate because of Lou's Waterbed Galleria. Mayor: (Sings) I'd like to hear that CD-R. (Spoken) Mmmm Tom you've got something special here. Tom: He actually plays the windchism himself on that track. Mayor: Oh boy. Listen to that melody. Lou: Wow this is really awful guys. Mayor: Lou you gotta be kidding me here. Uh this music is just beautiful. He's just gotta play at your waterbed grand opening. Tom: Oh ah ok. It's not really what I had in mind but uh yeah I'm sure we'd be interested in playing live. Uh as long as Lou doesn't have problem with it. Lou: Lou come on now tot da tot the saxophone. Honka honka the saxophone. Tip-aty tip-aty top saxophone a go honka honka I don't like it. Mayor: I'm sorry Tom I just don't think Lou can visualize the power of the saxman with just a CD-R. Tom: Hmm let me think, alright well this is just a brainstorm. Mayor: Ok Tom: But ahh what if I directed a video of the saxman that way we could show. Mayor: Mmmmmmm Mm Mmm (Whispers) I love it.
 * Mayor: Wow Lou, I gotta tell you this is just one heck of a.

 Saxman: Ahh cut. Cuuuut! Tom: Wha..what's wrong now Saxman? Saxman: Well I'm just used to playing with my shirt off you know. The shirt is just confining, I just have such wind when I when I blow that I need to. Can I. Bust out. Tom: Yeah I guess. Let's get some shirtless takes haha. Let's roll again. Saxman: Roll again. Tom: Back to one. Saxman: Ok....Cut cut cut cut. Tom: Ahhh what is it now Saxman? Saxman: I just feel uncomfortable. Tom: Why? Saxman: Well I think it's that I'm the only one with my shirt off now and that puts me totally out of balance with the flow and vibe of the mood and I'm trying to bring it, you see and it's not being brought. Tom: Ahhh. Saxman: Would you take your shirt off to. Just to keep me company. Tom: Uhh ok. (Tom removes his shirt) Saxman: Great. (An awkward pause ensues) (Tom covers up his exposed chest)
 * Tom: (sighs) Alright here we go again. Now Saxman just try and focus with me here. Action!

 Tom: Well thanks. Thank you very much. 'Mayor: But the shows over. Tom: What! Mayor: Well I've been thinking about this and it's just really doesn't make sense for your saxman to play at Lou's grand opening. I mean we'd actually like someone to sing about Lou's waterbeds and promotional offers. Your guy's mouth will be tied up due to tooting on his horn. Tom: Huh Well I mean ahh. Let me just throw this out at ya. I mean I could if I get some brochures together, educate myself on waterbeds maybe I could write some lyrics for saxman and uh you know I could sing 'em. Mayor: Mmmmmm mmm mmm mmm. You know I love the sound of your singing voice Tom.
 * 'Mayor: Wow Tom this is really what I had in mind. Great video, great directing.

 (Gasps) Saxman: Hey Tom: Oh geez Saxman, you scared me. Oh man what um why aren't you outside in your pup tent? Saxman: Oh it's so cold out there brother. It's frosty. Tom: Wait a minute Saxman, what's that on your legs there? Saxman: I found these tiny pants in this totally fun room. Tom: Those are Brendin's Saxman. My son's that's my step-son's room your fiddling around in. Saxman: Whoa whoa man, dude. Chill out, where's the anger coming from? Tom: I'm sa.. Saxman: Is this the way you treat a partner? Tom: Just really stressed out, got our concert tomorrow and and you know. I'm not exactly getting the luck of the draw with these lyrics here. Saxman: I have just the thing to calm you down my brother. (He pushes Tom down into the bed with his foot) Yeah get all snuggled down there. Tom: Saxman.. h-hold on a second- Saxman: Shhhhh. Let my sax notes massage your soul brother. (he plays his Soprano Sax in Tom's face, a colorful sleeping gas billows out) Sleep baby.. sleep.
 * Tom: (In his bedroom, singing to himself) If we don't ask for you costum (clears throat) If we don't ask for your customer code your waterbed will be 10 percent off oooff ff.

 Saxman: Half off. Tom: Right. Maybe you- Saxman: Half off.. Tom: can do a C sharp Saxman: See, you're a half step off on the half off. (laughs) Tom: Just trying to- Saxman: Half off. Tom: Yeah you're probably right. Uh, let me just make a note of that here. Ah, shoot I'm working on the bass cleft here. You know what Saxman? Let's take five. Um, there's actually something I wanted to get off my chest since this morning. Did you and your friends happen come in the house and have some kind of jazz jam last night? Saxman: What in how? No I slept like a baby right out there in my pup tent. Tom: Uh, that's weird. Just, uh, it's nothing.. There's just..there's some piles of BM in my bedroom and just uhh, something I don't know. You know what? Forget it. Let's take it from the top. 2,3,4. If we don't ask for your customer code... Saxman: Cut cuuuut. It's not working man. It's just not working. Tom:Aww, we'll get there, come on. You know we just need to rhyme some of these words. I haven't (sighs) Let's see what rhymes with consumer price rebate. Saxman: No no. It's not that your rhyming like diamond. It's just that, my lips are all chapped. I need to wet 'em up. Darn! Tom: What is it? Saxman: Well the best way is to kiss something for a while, you know. Just to moisten up my lips. Tom: Ooh..kay..? Saxman: Oh Tom, I wouldn't ask you if I knew another way, but you know we're burning studio time here. Tom: Oh I see your sayin'. You wanna ..wanna kiss me? Saxman: Well it's not so much that I want to but it's my chops, you know they need to touch another man's lips to bring them back to life. Tom: Oh, alright. I guess a kiss on the mouth between friends can't hurt. (Tom and Saxman ease in slowly for a kiss) (As soon as their lips touch, Joy and her children burst through the front door, witnessing the event) Joy: Ahhhh!! Tom: Joy! You're back! (Brindon takes several photos) Brindon: My step dad, and some man in our kitchen. (He places the photos in "Brindon's Memory Book")
 * Tom: Ok here we go. Alright let's take it from the top. 1,2,3,4 (singing) You're guaranteed to sleep. If we don't ask for you customer code, your second mattress is half-

 Mayor: Tom, it's me. Where the heck are you? Tom: Uhhh I'm at home, I..I got grounded. Mayor: Ooo that sucks. I wish you could have seen The Saxman he was great. Tom: Oh Mayor: Yeah Tom: He made it 'Mayor: haha Tom: I didn't know if he was going to make it. Mayor: He sold about...eight or nine cd's. I mean he made a huge profit out of the show. Tom: Oh..well we're not really working together anymore. Joy doesn't really want me, you know, hanging around with him, so. Mayor: Well that's a bummer. How long are going to be grounded for? Tom: Uh..uh probably a couple of weeks. Mayor: Ehh Tom: Hows the..hows the grand opening. Everything. Mayor: Yeah it was great Gimball Twins are playing now. Tom: Oh, uhh no I wish I could see them. I love the Gimball Twins. Mayor: Yeah they're hilarious. Tom: So umm. Well I should probably get off the phone. 'Mayor: Can you use the internet? Tom: No, not really,br> 'Mayor: Mmm, alright well. Tom: I'll talk to you later. Mayor: Ok you can call later. Tom: bye.
 * Tom: Tom Peter's phone.

Spray a Carpet or Rug [2.7]
Tom: What about my family? My friend said something about life insurance?

Mayor: Sorry, Buddy...

Surprise Party [2.8]
Gibbons: That sword is soooo awesome. Pretty good bargain for $800. nnaaaaaannnd I'm pretty sure it comes with an emerald sheath. _________________________________________________________________________________

Mayor: Okay lets see... party is a category C, small child, .. surprise party oh i love those! accessories... no. party for..? gibbons!? GIBBONS!!!!!!!!!!!

CNE [2.9]

 * Mayor: It's what we like to call Irritable Semen Syndrome. That would explain the burning and the rash.

 Joy: Well that's not going to happen. Doctor: And the other alternative is to perform emergency testicular surgery which would be quite intentsive and painful. I'm talking balls painful.
 * Doctor: Well there's really two ways to treat CNE. The first and easist is the simply examine your relationship with your wife.

 * Tom: Hi, I'm Tom Peters and for years I've not been able to control my unpleaseant and embrassing CNE but thanks to taking Provolanaproxalidamine-C, five times per day. My sheets, my bed, and my wife are all dry again.

 * Dr. Michael: Hey Mayor, your boyfriend's getting out of control.

 * Tom: Ahhh would you just go to hell!

 Tom: Uh, first off, it's Tom Peters here, and I'm.. I'm sorry did you say you had access to my medical records? Mayor: Of course he does Tom, Michael is a medical doctor. He's also the official rep for Provo-C. Tom: Uh, I'm just not sure what, you know, what that is.
 * Dr. Ian Black: Steven, I've been reviewing your charts and I think I may have a solution for your sticky problem.

Friendship Alliance [2.10]
John C. Riley: Yeah, like a garbage can before you wash it out. How'd you know?

Undercover [2.15]
Mayor: You've been a naughty boy. (taps hand with ruler)

Tom: Ok Mayor, I think we can drop the façade

Mayor: Get your ass up on my desk right now?

Tom: Darn, fair enough.

Mayor: Time for a spanking little boy.

Puddins [2.16]

 * Tom: (crying in fetal position on the floor of The Mayor's office) I want my son back!

Puddin's clerk: Get on ovah to sample town!!

 * Tom: This is gonna be delicious are they, Friends?

Mayor: Security, there's a baboon in my office.
 * Tom: Mayor.

Tom: No, i'm just...i'm just want of making a pajama pudding party.

title: Tom Goes to the Mayor


text:
Help:Template

In MediaWiki, a template is a page which can be inserted into another page via a process called transclusion. It is comparable to a subroutine.

This page and its extension Help:Template names, variable names and parameters depending on a variable or parameter provide a reference manual on templates in MediaWiki. For an introduction, see A quick guide to templates.

Notes:
 * The master version of this page is the page m:Help:Template on Meta-Wikipedia; template demos work there, but may not work if you are viewing a copy of this page on another project.
 * Templates can be used to control (part of) the page body, but not the margins (logo, sidebars, etc.). These are controlled by the skin, the user style, and part of the contents of the MediaWiki namespace.

General
The template namespace is the namespace with prefix "Template:" (this prefix can be used in all languages, but the canonical prefixes in languages other than English include Vorlage, Modèle, Sjabloon, with colon; the site WikiFAQ calls it Snippet).

A page in this namespace is called a template. The contents of such a page (either fixed or depending on parameters and/or variables) is designed to be useful for insertion in other pages (transclusion, creating a compound document).

The syntax for insertion of the page "Template:name" is. This is called a template tag. Example: abcdef gives abcdef.

This reference in the wikitext causes insertion of the template content when the referring page is rendered. Various equivalent terms are:
 * calling the template
 * referring to the template
 * including the template
 * transcluding the template
 * using the template

If the page "Template:name" does not exist, then works as  Template:name , a link to a non-existing page, leading to the edit page. Thus, one way of making a template is putting the tag first, and then following the link.

If name starts with a valid namespace prefix, or a colon, then it is not prefixed with "Template:". This way any page can be used as template (a colon at the start refers to the main namespace).

However, a page in the template namespace has advantages:
 * they are listed on the edit page of pages that call the template
 * when a page in the template namespace is changed, all the other pages that link to it automatically have their server caches (as opposed to browser cache) purged. With other namespaces, you need to purge the server cache manually.

Also it provides an alternative way of calling a template, which can be used in the case of a name conflict with a variable, e.g. Template:Ns:3 and Template:PAGENAME.

In the case of an image or category, it gives the description part. E.g. gives. However, if the image is on commons, the template call is treated as a link, which in turn is the embedding command, so the image is embedded: gives:

Using a page outside the template namespace as template can be useful for:
 * quoting interface messages in the MediaWiki namespace
 * experimenting with templates in subpages of one's userpage
 * using as the caption of an image the editable part of its image page
 * inclusion of pages in other pages in the same namespace, e.g. having an extra page associated with each page, such as a to-do list, with a simple name correspondence; it can be created and included with.

As usual the template name is case sensitive except (on most projects) for the first letter, and a blank space is equivalent with an underscore (as opposed to parameter names, see below: they are case-sensitive, even with respect to the first letter, and spaces are distinguished from underscores).

One can call a template that calls another template. If a template calls itself directly or indirectly, inclusion works only on one level for each template. However, with templates redirecting to the template that one would want to call recursively, one can achieve recursion without having to make copies of the whole template content, with the number of levels limited by the number of redirects. See also Repetition within a page.

A variable in a template is evaluated after insertion in the referring page, i.e. if occurs in the wikitext of a template, it is rendered as the name of the referring page, not the name of the template.

A list of templates used on a page, all with links, is given on the edit page. Notes:
 * only those in the template namespace are given, not pages in other namespaces, transcluded in the page
 * even on a section edit page the whole list is given, i.e. also the templates used in other sections
 * even when editing an old version of a page, the list is given for the current version
 * templates for which the tags have not been saved yet are not shown, even on the preview page

(Supported in version 1.4 and higher.)

When saving a page without newline at the end, and going to the edit page again, there is a newline at the end. However, this does not seem to have effect, see the example above and the following example:

using Template:Numbered list demo, gives

Use of templates across projects
A template only works when referred to from a page in the same project. To use it in another project, one has to copy it to there. 1126 is a request to lift that restriction, i.e. allow interwiki use of templates.

The adjustments needed in the copy, to work on the other project, can be reduced by using, localurl, and generic namespace names, and writing links in a way that works on multiple projects, e.g. m:Help:Table. For copying multiple templates, export and import can be helpful. It is also convenient if the template names can be the same on the other project. Therefore, when choosing template names, check which names are in use on other projects to which people might want to copy the templates. Note that if a template is referred to by something like abc, a project with different namespace names requires a different template name, or a redirect.

Transclusion across projects, hence changing contents from a central place, is only possible:
 * for content in the form of an image on Commons, to any page,
 * for editable content on an image page on Commons, including content transcluded from other pages on Commons, to the corresponding local image pages, if there is no local image with the same name

 * Those on the central Wikicities work in the separate Wikicities projects, provided that the prefix "wikicities:" is used, see wikicities:Help:Shared templates.
 * Please note that these external Wikicities projects are NOT hosted and managed by the Wikipedia Foundation.

Parameters
Template parameters are either named or numbered. They are called-by-value, and therefore input parameters only. The syntax is   with tags   ,   , etc. in the template, or    with tags   ,   , etc. in the template. The default (optional, together with the pipe character in front) can be different for every occurrence, and applies if no value is specified when calling the template, not to be confused with the case that the empty value is specified. Thus the formal parameter (the placeholder for the parameter value) is the parameter name with three pairs of braces.

Thus the template mechanism involves the following steps:

 * in template calls the template name, parameter names and parameter values depending on variables are evaluated; the result of this step can be viewed by applying subst (possibly multiple times), save and edit, see below; in the case of a variable depending on a variable this may have to be done a second time;
 * the values are assigned to the parameters from left to right (the result can not be directly viewed), meaning that a named or numbered parameter may be specified several times, the last one being the actual value that will be kept when passing the parameter during the final instanciation of the template below.
 * template calls are replaced by template content, where the parameter tags with matching names are replaced by their values or defaults (the result of this step can be viewed by applying subst either again, or directly to the template and the variables).

The process is applied recursively until there are no more template calls to replace.

Spaces before or after a parameter value are normally ignored:
 * "a" gives "a".
 * "a" gives "a".
 * "a" gives "a".

A parameter value can contain a piped link; the "|" in such a link is not taken as parameter separator.

 * Example: "a|b" gives "a|b".
 * Example: "a|b" gives "a|b".

(In this case the space has effect.)

On rendering, surplus parameter values (including named parameters that do not occur in the template) are ignored: b gives b.

Parameters without names (i.e. that don't contain an equal sign) are numbered implicitly starting by 1, from left to right.

 * Example: "b" is equivalent to "a"

Numbered parameters can also be skipped or can be specified in alternate order by numbering them specifically.

 * Example: "a" is equivalent to "a"
 * Example: "b" is equivalent to "a"

Template calls can contain multiple occurences of the same named parameter, and a numbered parameter can be specified multiple times by using its number explicitly. The effective value of parameters is the value of the last occurence (from left to right) of the parameter with the same name, once the parameter names have been evaluated.

 * Example: "b" is equivalent to "B"

The final list of formal formal parameters before the template itself is instanciated is then unordered because the list is indexed by the evaluated parameter named (this list is an associative array).

A useful example that uses of multiple assignments of parameters with the same name (and thus allowing parameter overrides) is performed in the en:Template:If defined call1 template used for example in English Wikipedia (and many other localized editions).

Restrictions on parameter values

 * If a parameter value contains an equals sign, the parameter name must be put explicitly, even when it is 1, 2, 3, etc.

 * If the expression for a parameter value contains two consecutive closing braces which are not part of a variable or parameter tag, they have to be put in nowiki tags.

 * If the expression for a parameter value contains a pipe character (|) which is not part of a piped link or within an image tag, it has to be put in nowiki tags: |.

 * The expression for a parameter value cannot contain the variable localurl with query string, due to the pipe character.

 * A parameter value can be quite long, see Help:Long parameter demo.

 * A parameter value can contain pairs of square brackets or text to be used within a link, but not a closing part of one link and an opening part of another link:

Named vs. numbered parameters
Advantage of numbering:
 * in the template call no name or "=" is needed; this means less to type and also less to memorize or lookup (on the other hand, one has to memorize or lookup the order); an exception is when the value contains "=": then the other equals sign is needed, with the parameter number in front.
 * numbers are international, both in the template tags and in the parameter tags in the template, no parameter name has to be translated (alternatively, one can e.g. use English names, only editors would see them and need to understand them)

Advantages of naming:
 * the order of specifying the values does not matter
 * a dummy unnamed parameter for comment and for formatting the template call can be inserted at any time, without planning in advance or renumbering (in the case of unplanned insertion of a dummy parameter between numbered ones, the text has to contain an equals sign; this works even if there is a newline somewhere before the "=", although a newline is not allowed in a parameter name).
 * the template is easier to understand
 * some special techniques use the fact that multiple assignments of values to the same parameter in the same template call is allowed and results in the last value being used; this implies that at least one parameter name is specified explicitly in the template call

Mix of named and unnamed parameters
In the case of a mix of named and unnamed parameters in a template tag, the unnamed parameters are numbered 1,2,3,.., so they are not numbered according to the position in the mixed list as a whole.

Template page
The following are identical:
 * the rendering of the wikitext of the template (this is on the template page, and would be the same in other pages with that wikitext)
 * the rendering of the template on a page that calls it without parameters

Thus the defaults are shown.

Template page if no defaults have been specified
In simple cases this corresponds to treating the parameter tags as ordinary text, for example:

"" (using Template:t2 containing ) gives

Similarly, if part of the parameters is undefined, only those show up as.

However, if a parameter is in another template call, then, as a result of what was explained in the previous section, the template page seemingly demonstrates an error in the wikitext: it is confusing, as a result of parsing the code differently from when it is used, i.e. called with a parameter value.

Thus, for getting informed about the contents of a template, just looking at the template page is insufficient (because it is ambiguous) and misleading. Note also that variable tags are not shown, but evaluated. However, some formatting aspects may show up which are not readily seen from the edit box.

Template talk page
The template page is of a different nature than other pages. It is not for explaining anything to the reader, but for defining the template for the system (this is done by the wikitext, the rendered page is just a by-product). Therefore the template talk page has an especially important role. It typically consists of two parts:
 * the first part explaining the template and its parameters
 * preferably examples are given of template calls (put them in nowiki tags) and the results (put the template call without nowiki tags in the wikitext)
 * the second part used for the ordinary talk page function

In complicated cases, "subst:" can be very helpful in the explanation, see below.

A parameter value depending on parameters
As mentioned above, if a parameter is left undefined, the triple braced parameter name in the result does not function as a parameter if the page is called as a template from another page; if it should, do not omit the parameter value but specify it in terms of a parameter of the calling page; compare:
 * (using Template:t2a containing ) gives
 * (using Template:t2a1 containing ) gives.
 * Similarly, (using Template:t2a2 containing ) gives . See also below.

The most straightforward way of expressing a parameter value in terms of a parameter is using the same name and making it equal, e.g. in Template:Lan is mr.

Remarks
makes the first parameter equal to the empty string rather than leaving it undefined: it gives. By treating the second unnamed parameter as a parameter with the name "2", the first unnamed parameter can be left undefined.

 * Example:  gives.

If the parameter is used in a tag like the default text may give invalid code that is conveniently ignored, rather than resulting in perhaps ugly code being rendered (but this may depend on the browser). See e.g. Template talk:Fontsize.

Parameter names (as opposed to template names) are case-sensitive, even with respect to the first letter, and spaces are distinguished from underscores. The empty string is also a valid parameter name, see Template:T empty string as parameter name.

Parameter 02 is distinguished from parameter 2.

Note that parameters in the MediaWiki namespace (interface messages) are written differently: as $1, $2, etc., see Meta-Wikimedia:MediaWiki namespace text.

Equals sign in parameter value
When a parameter value contains an equals sign, the parameter name must be stated explicitly, otherwise the part of the parameter value before the equals sign is taken as the parameter name. If that happens accidently, this parameter is likely to be unused, hence harmless, but the intended implicit parameter 1, 2, or 3, etc., gets no value.

 * Example:   gives  (unused parameter a is assigned the value b, the first parameter value for which no parameter name is specified is assigned to  the parameter with the implicit name "1" —   it reads like so: Use template TTT, assign "b" to the perameter "a", use the value "c" for your first implicit parameter  .), while  gives  (the first parameter is assigned the value "a=b" — it reads like so: Use template TTT, assign "a=b" to the expressed parameter "1", assign "c" to the expressed parameter "2").  In this case, if template TTT had a perameter,  , "d" would be assigned to "3" as first implicit parameter without a value.

The same applies if a parameter value depends on a parameter, and may therefore contain an equals sign. Compare:

 * (using Template:t2a1 containing ) gives.
 * (using Template:t2a2 containing ) gives.

msgnw
The prefix msgnw (short for "message, nowiki") is used to display the uninterpreted wikitext of a template (the same thing you'd see if you were editing the page) on another page. An exception is that numbered and unnumbered lists are rendered as such instead of displaying # or * signs. Parameter values are ignored.

Examples:

Template:en
 * gives
 * gives

Template:t2
 * gives
 * gives

Template:Numbered list demo

gives:

gives:

The edit box shows:
 * 1) Amsterdam
 * 2) Rotterdam
 * 3) The Hague

Link for editing a template
An edit page shows template tags in the edit box, not the wikitext of the included templates. A list of links is provided to the templates used on the page. To edit a template, one can follow the link, and go to the edit page of the template.

More convenient is to have a special link for editing the template on the calling page. This link can be put in the template itself. Since these edit links are similar for various templates, it can be made a template itself, with the name of the template as parameter. See e.g. en:template:edit and Train.

For a template containing only one paragraph or less, without links or images, one can also make the whole contents link to the edit page.

This is e.g. convenient for editing an individual entry in a table, without having to search in the wikitext of the table.

Usage
Templates are useful for any text for which one wants a copy in two or more pages, and there is no need for each copy to be edited independently, to adapt it to the page it is in. Since parameters can be used, versions may to that extent even be different, and parameter values can be edited independently for each. Templates are not only convenient, but they can also "force" a useful uniformity. See also advantages of subprograms.

Typical applications are:
 * template messages such as w:en:Template:stub
 * navigational templates such as w:en:Template:europe
 * infoboxes, each time showing the same kind of information in the same format, but each time for a different case, using parameters, e.g. the w:en:Template:Infobox Countries.
 * provide cross-language portability of texts which are largely internationally the same, but contain some standard terms different in each language; the standard terms are replaced by referring to template pages which have the same name but localised content in each language. This is applied in Wiktionaries for names of languages, terms like "noun", etc.; it is also applied for taxoboxes, see e.g. w:en:Template:Familia and w:fr:Modèle:Familia.
 * allow a composite image, composed of a table of images, to be specified by a template tag which itself has a corresponding table-like lay-out, see w:en:Template:Chess position and w:en:Template:Game of Go Position (the latter example also shows that the number of parameters a template can have is quite large, in this case 362). Newlines in parameter values provide the lay-out of the template tag, but they are not allowed in image names, therefore they are put within comment tags; alternatively, dummy parameters could be used on these positions.

Various combinations are possible. E.g., the last two could be combined, so that e.g. every language version of Wikipedia has the same Infobox Countries template (for each project a copy, because the template mechanism can not import across projects), which has parameters for the data, and refers to templates with translations of standard terms.

See also Help:Template names, variable names and parameters depending on a variable or parameter.

Navigational templates
A common, simple type of navigational template in a hierarchy of pages is one with the names, with links, of a parent page and child pages. It is placed on all the pages it lists. Thus a page that is not at the top or bottom of the hierarchy has two templates, one with its parent and siblings, and one with its children.

Variations also occur, such as pages having two parents, etc.

Self links do not give any complication: they are neatly displayed in |bold and not as link. However, templates should have the correct page names and not rely on redirecting, since the feature does not work in that case. Also for a link to a section the self-link feature does not work.

A navigational template may also just allow going forward and backward in a linear sequence, e.g. en:Template:Pope. For the predecessor of the first and the successor of the last a message like "none" can be used. This is not applicable in the case of a cycle, such as the days of the week.

Composite pages
The wikitext of a page may (partly or fully) consist of tags for the inclusion of component pages. The "templates" are not necessarily in the template namespace, and may be more or less self-contained pages by themselves. An advantage of putting the components in the template namespace is that they are then included in the list of templates used on the composite page, all with links, on its edit page. On the other hand, the component page may, by itself, be of a nature that it belongs in e.g. the main namespace, while the prefix would suggest otherwise; also the prefix would clutter the pagename.

Examples are:
 * w:en:Wikipedia:Village pump with six component pages, e.g. w:en:Wikipedia:Village pump (technical)
 * daily a page like w:en:Wikipedia:Votes for deletion/Log/2005 May 31 where each component page consists of the discussion on the deletion of one Wikipedia page, e.g. w:en:Wikipedia:Votes for deletion/Sp3tt (for this day there are 75 of such component pages)
 * m:Meta:Translation/Coordination, mainly containing
 * m:Meta:Translation/Coordination/List/Meta
 * m:Meta:Translation/Coordination/List/Main

This allows the user the choice between viewing the component pages separately or combinedly. One may want to view a page separately if one has a slow connection; also sometimes people have sentimental reasons for having a separate page about a topic, e.g. a village. Viewing the combined page is much more convenient if there are many small component pages; even if a subbtopic page does not provide additional info, if it exists anyway, and is linked to, it is useful to display the content (making clear that the whole content is shown), it saves the trouble of checking the contents by following the link.

In the latter case the search function of the browser can be used for searching in the combined page. Similar to the section editing feature, it allows editing a component page; however, there is no possibility to have the combined wikitext in the edit box.

Edit history, recent changes, watching pages, and "what links here" work separately for the component pages and the composition page, not for the composite page. Related changes works for the component pages and for the composite page. Page protection can be set for selected component pages and for the composition page, not directly for the composite page.

The talk page of a composition page is used to talk about the composition and the page in general, and could in addition be a composite page of the talk pages of the component pages.

A composite page has an integrated TOC and section numbering; the numbering is not reset for each component page.

Editing a section of a component page can be done directly from the composite page, see editing sections of included templates. After saving, one ends up at the page for the component page to which the section belongs.

On projects with the interlanguage link feature the composite page shows the combined interlanguage links of all component pages, hence possibly multiple links for one language or even for one page.

For easy access to the component pages, links to them on the composite page (for example by self-links on the component pages) are convenient. Alternatively, access is through section editing, or, if the component pages are in the template namespace, through the list of templates called from the composite page, at its edit page.

Conversely, for easy access from a component page to the composite page(s) that call(s) it (if there are not too many of them) it is convenient to link the component page to them (on a composite page one becomes a self-link).

See also w:en:Wikipedia talk:Template namespace.

Pages with a common section
A section on the relationship of the subjects A and B, or a subtopic equally relevant for A as for B, can be put both in page A and in page B, by making it a separate page C, called as a template from A and B. Remarks:
 * For readers reading both A and B, it is useful that the duplication is indicated by a message or a special lay-out; otherwise it is confusing and inconvenient.
 * After saving one ends up viewing the template page. For easy access to the calling pages it is convenient to link the called page to them (on a calling page one becomes a self-link). This may well be integrated in the message about the duplication. It is even more convenient than the two-step link as shown above.
 * The section level of the embedded section(s) has to be the same in each embedding page. The same applies to lay-out and style.
 * Pages like C can be put in
 * the same namespace as A and B; advantage:
 * the kind of content of C is the same as that of A and B
 * the template namespace; advantages:
 * C appears in the list of templates called from A and B, at their edit pages
 * C by itself may not satisfy the standards for pages in the namespace of A and B, such as providing context (however, the message about the duplication explains it)

For various remarks which also apply here, see also the previous section.

Repetition within a page
For a succession of similar pieces of content, as in a list, a computer program would use a loop. What comes closest in MediaWiki is putting the loop body in a template, and calling the template repeatedly, usually with a varying parameter value. This is somewhat primitive for a loop:
 * instead of "for i=1 to 5" we need to enumerate the values 1, 2, 3, 4, 5; on the other hand, this gives the versatility to use just as easily less regular values such as de, en, fr (collection-controlled loop).
 * repetition of code is minimized by the template, but the template call itself has to be repeated each time (but see also the next section)

Example:
 * Template:List of Languages - the "loop body" is in Template:Lang def; compared with putting the content of the latter directly in the list the advantage is that the variable part (the value of "code") occurs once each time in the code, although it is used twice. This is important because the fixed part of the list item code can be copied while the variable part is typically inserted manually.

For repetition of the same text the loop body can be a parameter, e.g. Template:X5 (see list).

A double loop is achieved by a second template that repeatedly calls the first. Similarly for a triple loop, etc. See e.g. w:en:Template:Ld, w:en:Template:L2d, and w:en:Template:L3d.

An example where the same template is used for different loop levels is Template:Loop 2. Because the software has a built-in protection against infinite nesting (if there is, there will be an error e.g. ), a redirect is used for each level. The number of levels that the template can handle is determined by the number of parameters specified in the two template calls it comprises (because going up a level requires an extra parameter) and the number of existing redirects.

Similarly Template:Lanlp 1 is used for both the inner and the outer of a double loop. Adding an item (here a language) adds to each row and also adds an extra row.

Providing effective repetition without repetition of similar template calls in the wikitext
A technique for repetition of similar template calls without actually putting this list in the wikitext is demonstrated in m:Template:List of template calls. For an arbitrary template with up to three nameless parameters, it is equivalent to calling the template repeatedly, with the first parameter varying, and the possible other parameters fixed: one specifies the name, the values of the fixed parameters, and the list of values the first parameter should have in consecutive template calls, with a sequential number each, and ending with "end". The technique requires redirects like Template:List of template calls 3, as many as the maximum number of repetitions.

If e.g. the second parameter varies, or two parameters, then a similar template can be made, but each version requires its own set of redirects.

Example :

gives:

The empty parameters are needed in accordance with the maximum number of parameters the repeated template can have (currently three) and the maximum number of repetitions. Putting more empty parameters than needed at the end does not matter, but the number of empty parameters in the beginning of the list should be correct.

Images in templates
New: In a template, image code parameters can contain template parameters, e.g.

For cases for which an image is not applicable or available, use a dummy image such as.

For an image in a template that should be different for each page in which the template occurs, there are also the following possibilities:

 * a parameter value can contain the whole image code: [[Image:Tst.png|50px|bullet]] gives [[Image:Tst.png|50px|bullet]]
 * in projects where external images can be embedded, the url of the image can be a parameter: http://meta.wikimedia.org/upload/2/27/Tst.png gives http://meta.wikimedia.org/upload/2/27/Tst.png

 * Note that this does not work on projects hosted by Wikipedia, due to local restrictions about external references to embedded images (or objects or scripts or stylesheets): these images can only come from the local projet (and will be served by the "http://upload.wikipedia.org/" base URL, the complete effective URL being computed and forced by the special [[Image:]] template), or alternatively the images can be imported automatically from the Wikipedia Commons project where they will be found if they are not present in the local project.
 * Without this restriction, meant for security, it would be possible for any visitor to include the external reference of an image hosted somewhere else, that would either violate a copyright notice, or would contain in fact another object than an image, such as a malicious script that would be downloaded automatically by the browsers used by all visitors of the Wikipedia article that embeds such fake image.

 * the image is given a name of the form prefix suffix (with a suffix, consisting of the file name extension and possibly more, and possibly also a prefix). See examples below. Note that there is little flexibility: changing the name of a page in which the template occurs requires uploading the image again, with the corresponding name.

Internal links
In the case of an internal link in a template with the target depending on a parameter, and in the case of a link with the target depending on a template, existence detection works as usual.

Interwiki links
Templates can contain interwiki links; this normally means all pages using the template will have the interwiki, which is usually a bad thing unless some fancy footwork is done. To link just the templates across wikis, use the   tag. For example:

de:Vorlage:Korrekter Titel en:Template:Wrongtitle es:Plantilla:Título erróneo fr:Modèle:titre incorrect

Be careful when adding categories or interwikis within templates which are meant to be used inline, including within tables or lists: don't add newlines before <noinclude> or after </noinclude> because they will be kept in the resulting wiki code used to generate the page that references that template.

It is recommanded to insert <noinclude>...</noinclude> at end of articles and templates, by first dropping the newline present at end of all existing articles and templates. The single newline that Wikipedia requires or adds automatically after </noinclude> is discarded when the template is instanciated for rendering the articles that include it.

See also below.

Navigational images
The following applies in projects where external images can be embedded.

Examples where the label contains an image and depends on the parameter or template:

 * cd
 * cd

Notes:
 * the c and d are used to show the more general case, without them the label is instead of contains an image, with perhaps help:link giving help:link the more useful kind.
 * the target can be made variable like above.

Noinclude and includeonly
This feature is not available before version 1.6.

Anything between and will be processed and displayed only when the page is being viewed directly, not included. Possible applications are:

 * categorising templates; including a page in another page without putting the including page in the categories the included page is in; in particular this is useful when including an article in a user page or test page
 * interlanguage links to similar templates in other languages (Otherwise such a link appears in the edge of the page that includes the template, giving the impression that the link is to a version in the other language of the referring page instead of the template. The link label depends only on the sister project that is linked to, not on the page; it is set in the configuration of the project, typically it is the name of the language in that language. The target is only shown in the hover box and the status bar, depending on the browser.) - see also above.
 * pages in the MediaWiki namespace
 * explanatory text about how to use the template

The converse is. Text between and will be processed and displayed only when the page is being included. The obvious application is:

 * Adding all pages containing a given template to a category

Note that the usual update problems apply -- if you change the categories inside a template, the categories of the referring pages won't be updated until those pages are edited.

With these tags a page can also call one of two specified templates with the same parameters, depending on whether the page is included in another page, by putting the tags in the template name part of the template call, as in. See also $π$, where page content is arranged such that a selection of it can be displayed in a different format in a table row.

"subst" (see below) includes everything, also these tags.

Note that spaces and newlines between the general content and e.g. the noinclude part are part of the content, so if they are not desired the include tag should directly follow the content without space and not on a new line.

A category tag in a template; caching problem
If a template contains the code indicating that it is in a category, this does not only put that template in the category, but also the pages that include the template. Thus this is typically not applied to categorize templates, but to conveniently put pages in a category, based on the template they use. For example, this page includes Template:H:h and as a result is in Category:English documentation.

The page that contains the template correctly lists the categories to which it belongs. However, adding or deleting a category tag in the template does not add or delete the listings on the category page of pages that use the template, until some edit is made in the page that uses the template.

In other words:

 * lists of categories a page is in, are up-to-date
 * lists of pages in a category are based on the situation just after the last edit of the pages

Since adding or removing a category or template tag is obviously an edit there is only a complication when a page is indirectly added to or deleted from a category, through a change in a template the page uses.

To refresh category pages with respect to the listing of a particular page (adding or deleting the entry), a null edit can be applied to that page: just applying section edit and saving without changes.

Thus, a basic principle of templates, that changing the contents of a template automatically changes the pages that contain the template, does not extend to these pages being correctly listed on category pages. It still works, with a delay, for sets of pages which are all frequently edited anyway, for other purposes.

In other cases the principle is violated. What remains is that just making null edits is somewhat less cumbersome than changing category tags in each page.

In conclusion, adding or deleting a category tag in a template that is already in use should be avoided unless one is willing to make the null edits, or is willing to accept the (possibly very long) delay during which there is no consistency between the category pages and the category listing on the pages in the categories.

Newline in a template
A single newline works like a space, except in a list, there it breaks the list. Since templates containing a single paragraph or less could be called from a list, such templates should avoid single newlines.

Indentation or list code at the beginning of template content
Each of the markup characters ':;*#', at the beginning of template content, is interpreted as being at the beginning of a line (even when the template call is not). This also applies to parameter values that appear at the begining of the template content. The effect can be disabled with nowiki tags.

Examples (nowiki examples use capital 'Def'): abcdefghi

abc<nowiki>:</nowiki>D1efghi

abc:d1efghi

abc<nowiki>;</nowiki>D2efghi

abc;d2efghi

abc<nowiki>*</nowiki>D3efghi

abc*d3efghi

abc<nowiki>#</nowiki>D4efghi

abc#d4efghi

gives: abcdefghi

abc: D1efghi

abc:d1efghi

abc; D2efghi

abc;d2efghi

abc* D3efghi

abc*d3efghi

abc# D4efghi

abc#d4efghi

Server cache impacts
When a template (in the Template namespace) is edited, the cache is cleared of all pages that include the template (at any nested level). When a page is viewed, and not in cache, the output HTML has to be reconstructed. Consequently, editing a template has a server impact (roughly) proportional to the number of pages dependent upon it.

For load constrained projects, template designers should consider long term edit impacts for templates that will be used in a large number of pages, particularly from template nesting. Projects may establish performance related policies, e.g. w:en:Wikipedia:Avoid using meta-templates, a guideline to avoid high-usage, nested templates.

The following can be used as a simple model. If a template is called from p pages and edited with a frequency e, while the pages are viewed with a frequency v, then the relative amount of work for rebuilding the page (as opposed to taking it from the cache) is, per unit time:
 * if ev: pv (each time a page is viewed, it has to be rebuilt)

If the edit frequency varies, then the amount of work for each time segment has to be considered separately, and added. For example, if a template is called from 1000 pages, each viewed once a day, and if each month four edits in a row are made to the template, then the first induces a lot of work (1000 page refreshings) and the other three very little. Compare this with having four edits spread over the month, i.e. every week a single edit is made to the template, which causes 1000 page refreshings every week, or 4000 for the month.

Note: some impacts (not distinguished here) occur immediately when the template is saved, others are distributed over the time when the template is used. Many additional factors need to be considered for an accurate cache model, too numerous and intertwined to be included here. The simple fanout and frequency model still applies as a first order estimate.

Stale cache purge
When a page in the Template namespace is edited, this automatically clears the cache of any pages which use that template. However, there are cases of indirect dependence where a page may still not be up-to-date, even after pressing Ctrl-F5 or similar. This is e.g. the case for pages (typically template talk pages) referring to en:Template:Tc, containing, probably because the template page name referred to depends on a variable.

Pressing Ctrl-F5 or similar generally only refreshes the browser cache, not the server cache. To purge the page server cache and a force full update, use "action=purge", in a URL like.

Subst
Putting "subst:" after the double opening braces causes an automatic conversion of wikitext when the referring page is saved: the subst tag is replaced by the wikitext of the template, with the parameter values substituted for the parameters. However, "noinclude" and "includeonly" are not applied: everything, including these tags, is included. Subst can also be applied to a variable.

Example: a will give the wikitext start-a-middle--end, which is rendered just like  :.

The replacement of a template tag by wikitext does not automatically work recursively: if the template calls another template, that tag is not replaced. One can subsequently add "subst:" again, thus doing manual recursion. This stepwise replacement can be useful for analyzing and explaining the working of templates calling other templates. See e.g. Template talk:Lop. However, it requires applying "noinclude" and "includeonly" manually, or, if the "includeonly" content is plain text (not used in a template name or parameter, etc.), at least disabling the "includeonly" tag by changing one character of it, in order to see the text.

It can also be used to create a page independent of templates, as a way to archive the rendered page and allow a permalink to it. See also 2777, a request for a version of subst that automatically works recursively.

If you want to use a modified version of the resulting wikitext, you have to save the page with the unmodified wikitext first, then edit it, because when applying preview the subst code is not yet replaced in the edit box. In the edit summary of the temporary edit you can put "tmp" to indicate that you have not made an error but are still working on the page.

In the absence of parameters, an alternative that clutters the edit history less is, of course, copying the text from the edit box of the template page: then it can be edited before saving. Another method is using msgnw without saving, and copying the preview result into the edit box.

When subst is applied to a template:
 * a variable in the template is copied as such in the wikitext.
 * if the template call contains a variable, subst has to be applied to that variable as well, otherwise the first two closing braces of the parameter are interpreted as closing braces of the template.

Applying subst to a variable works like applying it to a template. E.g. a timestamp:

,    (UTC)

giving: 10 March 2005,   08:23 (UTC)

One might be tempted to put this in a template, but then it would display the time of creation of the template; on the other hand, without the "subst:", it would give the time of loading the page with the timestamp. Neither is suitable for a timestamp, which should give the time of saving the new referral to the template (like  does).

Usage of a template through "subst:" does not show up in page histories, backlinks, etc.

Input box
Similar to applying "subst:" to include page A in page B, in the case that B does not exist yet and that A does not have parameters, is using an inputbox to create B, preloading A. A difference is that the wikitext can be edited before saving.

Rewriting a template that calls other templates in a self-contained form
If a template calls other templates one may want to rewrite it in a self-contained form (i.e., which does not need other templates) in order to use a copy of it in another project, without copying more templates.

To do this semi-automatically, one cannot use subst without specifying a parameter, or with as parameter: the result of that is like the template page "t2a1" shows: "". In fact this is how the confusing rendering of a template page can be analysed.

Instead, one can apply subst with parameter "{{{1}.}.}." and obtain " ". If we now remove the three dots again, we have the content of "t2a1" in a self-contained form: "start-a-middle--end".

Case where a template name depends on a variable or parameter
If template A calls a template whose name depends on a variable or parameter, subst can only be applied for specific values of that variable or parameter, each resulting in a separate new version of template A, not for the general case. Saving e.g. " " does not change the wikitext (but the rendered text still replaces the effective variable or parameter value), which is rendered as just "", because the assumed template name contains braces, therefore the system concludes that the template does not exist.

Redirection
When a page called for inclusion is a redirect page, the redirect target is included instead. As usual, a double redirect does not work.

A page that consists of nothing else than the inclusion of another page as a template, shows similarities to a redirect to that other page, but also many differences, including:

 * the result has as header the name of the referring page
 * there is no redirect message
 * the buttons such as edit (for editing the whole page), watch, talk, history, "what links here", and "last modified", etc., refer to the referring page (to go to the target page, a section edit link can be used, from there the whole page can be accessed)
 * the referring page is in the same categories as the target page
 * "double redirects", with one or both being this kind of "pseudo-redirect", work.

Compare Help:Template namespace with Help:Template namespace - demo of alternative for redirect.

In a page that in turn includes such a referring page there is no difference.

Math tags
MediaWiki templates, variables and parameters cannot be used within math tags, see Template talk:Demo of attempt to use parameters within TeX.

A template looked upon as a subroutine
The wikitext of a page can be looked upon as a list of statements, in which case a template is a statement-type subroutine. Alternatively the wikitext is a string expression, in which case a template is a string function.

In the first view, a c is a sequence of three statements, in the second a concatenation of three strings.

In both views, the b in is a string expression: the value of an input parameter of type string; however, the expression involves only concatenation, not (as one might think in the second view) any string function.

A subroutine is selected based on evaluating the string expression for its name (so this is done at "run-time"), so the process seems like that of an interpreter.

The subroutine is the only programming construct / flow control construct.

There are no variables/constants or assignment statements, except in the framework of subroutine parameters. The only operator (see operator and operator (programming)) is concatenation.

A template itself can also be considered an operator, with the number of parameters being the arity.

Simple computations
Simple additions and multiplications can be performed based on concatenation, using the unary numeral system: when 2 is represented by 11 and 3 by 111, then concatenation gives 11111, which can be converted to 5. An additional parameter allows not only to display the result 5, but also to call a template of choice with parameter 5.

Required auxiliary templates:
 * for every value m used as first operand a template calcm containing
 * for every value n used as second operand for addition a template calcAn containing
 * for every value n used as second operand for multiplication a template calcBn containing
 * for every result r a template countr digits "1" containing
 * the template that one wants to call with the result as parameter; if one just wants to display the result, or use it in a link target, or in an image tag

In view of the maximum length of 255 for page names, the maximum result can be 250.

Note that for any computation one can prepare an array with all results, but the amount of work to do that is proportional to the number of pairs (m,n) that one wants to use, while above the amount of work is only proportional to the sum of the number of values of m, n, and r.

Linking to a template
Unfortunately, when linking to a template instead of embedding it, transfer of parameters is not possible. This would be useful e.g. for the following:
 * for a given image, allow links to pages each showing the image in a particular size, without having prepared a separate page for each size
 * for given geo-coordinates, link to a page such as w:Template:Mapeu with links to maps of that location; this would be like the Special:Mapsources feature, e.g. http://kvaleberg.com/wiki/index.php/Special:Mapsources/59_55_N_10_44_E, proposed as an extension of MediaWiki, except that no computations are possible, but, on the other hand, it would enable multiple editable "Map sources pages" in the form of templates.
 * Template:Table of Wikimedia projects provides a table of links to similar pages on all Wikimedia projects, depending on a parameter, e.g. all main pages, or all lists of templates. A page would be convenient with links to various of such tables, made on the fly.

Coming close to this is a page with links like Template pages and Template talk pages. These section edit links would each give access to one table through the preview. The whole page could be very large in rendered form, because the whole page would never have to be rendered (although on saving the system would attempt to do so even if it not desired). As far as the variation of the parameter for the last part of the URLs is easy, such as just changing the namespace number, not all tables need to be present, one can change the parameter in the edit box and get the desired table on the fly by the preview.

Comparison of linking and embedding
Linking and embedding have in common:
 * if the page does not exist, a link to the edit page is shown; the links are identical if it is not a piped link; the link does not show parameters and does not show whether, after creation, the new page will be linked or embedded.
 * the name can depend on variables and parameters

Extra possibilities of linking:
 * the name can depend on the content of templates; this is not possible for the name of an embedded page, not even indirectly: the name can depend on a parameter, but a parameter value or name can also not depend on the content of a template
 * the page referred to can be outside the project (interwiki and external linking)

Extra possibility of embedding:
 * there can be parameters, i.e. a single page can have different rendered content; this is not possible with a link; note that embedding a page with a link still does not allow the linked page to depend on parameters (see also the previous section)

Other differences:
 * the syntax or, etc., versus .. or .., with the pipe character having a different meaning
 * obviously the difference between having the pages rendered combinedly or separately
 * for embedding the default namespace is the template namespace (for the main namespace prefix a colon), for linking the default is the main namespace; prefixing a colon is also allowed, so one can use :...

Developing templates and template tags
When adding a parameter to a template that is in use, one can first adjust the tags, and then the template. During the work in progress, the template keeps working properly, but the new parameter becomes effective only at the end.

Alternatively, a new template name is used for the new version, and while adjusting template tags, the template name is also changed (for convenience, this is typically a small change, e.g. one letter or digit is added or changed). The advantage is that during the work in progress, the new parameter becomes effective on a page as soon as the tag has been adjusted. Also, the backlinks of both templates show the pages that are done and that still have to be done.

To accommodate future expansion of a template, involving more parameters, one can in advance add parameters with the empty string as their value to the template tags. If unnamed parameters are used, one does not have to plan in advance the meaning of the new parameters.

Version 1.4

 * Including the same template more than five times in the same page works from version 1.4, now on all Wikimedia sites. Also new was that subst can be used with parameters.

Version 1.3

 * See, among other things,.

Version 1.2.6

 * In MediaWiki version 1.2.6, make a page MediaWiki:mytemplate and refer to it with . In this version parameters are not possible.

 * Compatibility with 1.3, in the sense of having the content in Template:mytemplate, is possible with a redirect from MediaWiki:mytemplate to Template:mytemplate on the 1.2.6 project.

In versions 1.3 and 1.4 the prefix "msg:" is optional and ignored.

From version 1.5 the tag refers to  Template:Msg:abc !

Revision history of pages containing templates
Pages in the stored page history consist of wikitext with possible references to templates and images. When viewing an old version of a page, these refer to the current versions of the templates and images, if these still exist. Thus the former composite page is not reconstructed.

Reserved template names
According to the MediaWiki help policy some template names are reserved for use in the Help namespace. This allows copying without modification of the wikitext of help pages across projects. This wikitext contains template tags of the form " " which allow project-specific content within help pages, using project-specific templates.

Template names referred to by such tags are reserved, follow the link Template:h:f to see the full template name in this project in the case that rest of name  is "f ":
 * for English projects with case-insensitivity of the first character: template names starting with "Template:H:".
 * for other projects with case-insensitivity of the first character: template names starting with "Vorlage:H:" and "Modèle:H:", etc.
 * for projects with case-sensitivity of the first character: template names starting with "Template:h:", "Vorlage:h:", "Modèle:h:", etc.
 * for Hebrew "H:rest of name :" comes to the left of the Hebrew word for template תבנית, see he:Template:h:f, except that if rest of name  is the empty string than ":H:" instead of "H::" comes to the left of תבנית , see he:Template:h:. The reserved names are those of which the canonical form of the URL starts with " http:// he.wikipedia.org/wiki/%D7%AA%D7%91%D7%A0%D7%99%D7%AA:H:" and similar for the other Hebrew projects.

Note that "case-insensitivity of the first character" refers to the first character after the first colon, not after the second.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Help:Template


text:
Help:Namespace

Page titles in MediaWiki are composed of two parts: an optional namespace name, and the remainder of the title. For example, this page has the title : , so it is in the  namespace. A title without a colon, for example Goings-on, is in the main namespace.

Each wiki using the MediaWiki software has 16+2 namespaces: the main namespace, where page names have no prefix, 15 additional namespaces, each with its own prefix, and two virtual namespaces. In each project they are similar to the 18 explained in w:Wikipedia:Namespace for Wikipedia. One of these is the project namespace, which uses as prefix the project prefix (variable     below). Some projects have additional custom namespaces. For a list of all namespaces used on meta, see Namespaces.

Note: namespace prefixes should not be confused with prefixes for interwiki linking; see also Guide for system administrators for setting up interwiki linking.

If a page title contains a colon, but the initial part of the title is not one of the pre-defined namespaces, that page is considered to be in the main namespace.

Namespace uses
Namespaces among other things allow a separation of content from policy and discussion. They encourage separation of the pages of a wiki into a core set intended for public viewing, and private information intended for the editing community.

This core set is the main namespace. Other namespaces that are useful also for people who are just viewers are:
 * the image namespace (with the full-size images)
 * the category namespace (for navigation)
 * the help pages and the preferences page (as far as they concern viewing)

By default, searches and the random page feature are restricted to the main namespace, thus the user interface is directed towards readers who are not part of the community. Note that this separation of community and readership is not a feature of many wiki engines. It may not be required for your editing community. You are always free to put discussion and policy in the main namespace, if you desire.

On most Wikimedia wikis, pages in the main namespace and a few other ones are actively policed by the community, with inappropriate content being quickly removed. The rules for the other namespaces are generally more relaxed.

 * Special:Allpages can be applied to a namespace of choice

 * Searching can be restricted to any subset of namespaces

User contributions can only show all; not working anymore: or be restricted to a namespace of choice, see 2686.

It is possible to customise the visual appearance of pages by namespace; also enabling the subpage feature can be done for selected namespaces.

List of namespaces
The two virtual namespaces, main namespace and 15 auxiliary namespaces in this project (Meta) are as follows (the variables for them are also shown):

Note that all characters of namespace prefixes are case-insensitive, so one can write e.g "mediawiki".

The names are set in files such as those listed in Locales for the Wikimedia projects, with default Language.php:

/* private */ $wgNamespaceNamesEn = array(	NS_MEDIA           => 'Media',	NS_SPECIAL          => 'Special',	NS_MAIN	            => '',	NS_TALK	            => 'Talk',	NS_USER             => 'User',	NS_USER_TALK        => 'User_talk',	NS_WIKIPEDIA        => $wgMetaNamespace,	NS_WIKIPEDIA_TALK   => $wgMetaNamespace . '_talk',	NS_IMAGE            => 'Image',	NS_IMAGE_TALK       => 'Image_talk',	NS_MEDIAWIKI        => 'MediaWiki',	NS_MEDIAWIKI_TALK   => 'MediaWiki_talk',	NS_TEMPLATE         => 'Template',	NS_TEMPLATE_TALK    => 'Template_talk',	NS_HELP             => 'Help',	NS_HELP_TALK        => 'Help_talk',	NS_CATEGORY	    => 'Category',	NS_CATEGORY_TALK    => 'Category_talk' );

Automatic conversions of page names
On the column "Alternate syntax" in the table at the beginning of the previous section, a list of project-independent namespace names is shown in the form of    , the same as those on Meta and the English Wikipedia, except that "Meta" and "Wikipedia" are replaced by "Project". The prefixes are the terms listed, followed by a colon.

The prefix "Project:" is for every project automatically converted to the project namespace, e.g. try the link Project:xyz. It is like a piped link. Therefore a page name starting with "Project:" is not possible (unless, of course, that is the name of the project).

Similarly the other project-independent namespace prefixes are also automatically converted to the project-specific ones.

An exception to the rule that the link label is the name used in the wikitext and not the converted name, applies if the target of a redirect is expressed using a project-independent namespace name: in that case the converted name is shown on the redirect page, compare with the preview of.

Prefixes in various languages
For Wikimedia projects this project prefix is "Wikipedia:", "Wiktionary:", "Wikibooks:", "Wikisource:", "Wikiquote:", "Meta:", and in the case of In Memoriam also "Wikipedia:". In other languages than English, the Wikipedia project has its own prefixes: in French "Wikipédia:", in Czech "Wikipedie:", in Russian "Википедия:", in Korean "위키백과:", in Hindi "विकिपीडिया:", in Hebrew ":ויקיפדיה" and in Arabic ":ويكيبيديا". The last two are RTL languages which put the prefixes on the right. In URLs the prefixes are always on the left.

To check which prefix is used in a project, you may edit and preview a page in the project to render the variable     (and cancel the edit after the check), though what you will see is deprived of a colon. Another way: visiting any project page there, you will find it at the left (in LTR languages) or the right (in RTL languages) of the page title. This applies even for non-existing pages, so, in view of the conversion explained in the previous section, you can use a URL like http://ar.wikipedia.org/wiki/Project:A. Also you may go to a project page of a target language from a project page of a language familiar to you (e.g. en:Wikipedia:Contact us) by clicking an interlanguage link, if applicable. "Talk", "User", "Image" and combinations can also be translated in the case of non-English wikis. see Locales for the Wikipedia Software.

Colon in page name
Adding a colon to a page name does not automatically create a new namespace. To see the namespace of a page, use which returns the namespace. For this page it returns "". The same code would return an empty string for a page in the main namespace. Similarly, returns the page name without prefix. For this page it returns "".

To take some examples from Wiktionary: Wiktionary:FAQ has Talk page Wiktionary talk:FAQ, but Wiktionary Appendix:Colours has Talk page Talk:Wiktionary Appendix:Colours, because the first is in the project preface namespace and the second is not. In Special:Allpages, accordingly, the first is, unlike the second, not in the list of articles, but in the page list of the namespace Wiktionary. Unclear is why Wiktionary:Recentchanges is taken as an article.

Sites outside Wikimedia
Sites using MediaWiki but outside Wikimedia usually have their own project name as project prefix, but several have simply retained "Wikipedia:".

Interwiki linking is done with a prefix that is similar to namespaces.

Special namespace
Main article: Help:Special page

The namespace "Special:" consists of "special pages", which are created by the software on demand, for example Special:Recentchanges.

Custom namespaces
For instructions on creating a custom namespace or for more information, see Help:Custom_namespaces.

A project can have additional namespaces. For example, if a single project is multilingual (as opposed to the case of sister projects, each in one language) there may be a namespace Help: and also a namespace Hilfe:, for help pages in the English and German language, respectively.

Custom namespaces are numbered from 100.

For a full list of all namespaces in this project, see the search options of the preferences (Special:Preferences), or see the list in Special:Contributions/XX or Special:Allpages. In all cases they are in the order of ascending number, starting with 0 and without numbers 16-99.

The maximum number of namespaces is 256 (it is a TINYINT(2) in the SQL database), so custom namespace numbers are in the range 100-255. Hence there can be 156 of them, including talk pages, i.e. 78 custom namespaces and their talk namespaces.

The list of custom namespaces is $wgExtraNamespaces in LocalSettings.php.

Comparison of separate namespaces with separate projects
Compare, for example, having a separate projects in English and German, versus having a single project with separate namespaces for English: and Deutsch:

 * Srumberg

Largely disadvantageous aspects of separate projects

 * Not possible across projects:
 * existence detection of a linked page
 * related changes
 * what links here
 * use of templates
 * use of categories
 * message alert
 * user contributions can be shown separately or combined for namespaces within a project, but are always separate for separate projects
 * searching ditto

Largely advantageous aspects of separate projects

 * A link within a project does not require a prefix to specify that project, a link within a non-main namespace does require the namespace prefix.

Differences that can be advantages or disadvantages
Separate per project are:
 * Recent changes
 * Preferences, status such as sysop
 * Watchlist

Tab labels
The first tab shows the namespace. See the link, if it is there, to see what it is in this project. For Meta-Wikipedia it is as shown on the right.

 * category: mediawiki:nstab-category => ""
 * help: 'nstab-help' => "Help",
 * image: 'nstab-image' => "Image",
 * main: 'nstab-main' => "content page",
 * mediawiki: 'nstab-mediawiki' => "Message",
 * project: 'nstab-wp' => "About",
 * template: 'nstab-template' => "Template",
 * user: 'nstab-user' => "User page",

The second tab, linking to the talk page:

 * Talk: 'talk' => "Discussion"

On a diff page or a page with an old version, the links are to the current version (however, the edit tab on a page with an old version links to the edit page of that old version; this does not apply on a diff page comparing two old versions, there the edit tab links to the edit page for the current version).

The self link feature (a self link appearing as bold text) does not work for the tabs, no distinction is shown between a self link and a link to a different (version of a) page.

With the class "selected" one can let the tab for the same namespace as the current page (either a self link or a link to the current revison) be displayed differently; also the tabs "edit" and "history" are then displayed in this different way when applicable.

title: Help:Namespace


text:
Talk:Alfred North Whitehead

Well, there is another quote, attributed to A.N. Whitehead - it appears in Wikipedia under Infinite Monkey Theorem ,the quote being 'I will not go to infinity'. If anyone could verify this quote, it could be added to this page.

Source for expansion
alfred.north.whitehead.com/witwiz/witwiz9.htm --Tickle me 16:35, 26 December 2005 (UTC)

Sourced vs. unsourced
The first two quotes in the "sourced" section ("Unlimited possibility ..." and "There is a quality of life ...") are, in fact, unsourced. Are they supposed to be from the same book as the third quote? I'm moving them to the "unsourced" section. --75.15.115.31 15:47, 25 December 2007 (UTC)
 * As it turns out, they are from the same source (Religion in the Making) but appear to have been improperly formatted. I have restored them to the Sourced section and provided links to the texts. - InvisibleSun 16:52, 25 December 2007 (UTC)

Unsourced
Wikiquote no longer allows unsourced quotations, and they are in process of being removed from our pages (see Wikiquote:Limits on quotations); but if you can provide a reliable and precise source for any quote on this list please move it to Alfred North Whitehead. --Antiquary 17:00, 26 April 2009 (UTC)
 * But you can catch yourself entertaining habitually certain ideas and setting others aside; and that, I think, is where our personal destinies are largely decided.

 * Common sense is genius in homespun.

 * Dogmatic common sense is the death of philosophic adventure. The universe is vast.

 * I have suffered a great deal from writers who have quoted this or that sentence of mine either out of its context or in juxtaposition to some incongruous matter which quite distorted my meaning, or destroyed it altogether.

 * It is more important that a proposition be interesting than that it be true. This statement is almost a tautology. For the energy of operation of a proposition in an occasion of experience is its interest and is its importance. But of course a true proposition is more apt to be interesting than a false one.

 * We think in generalities, but we live in details.

 * There remains the final reflection, how shallow, puny, and imperfect are efforts to sound the depths in the nature of things. In philosophical discussion, the merest hint of dogmatic certainty as to finality of statement is an exhibition of folly. -Process and Reality - preface - copyright 1978 edition by The Free Press page XIV

 * Not ignorance, but ignorance of ignorance, is the death of knowledge.

 * The pursuit of philosophy is the one avocation denied to omniscience.

 * The process is the actuality.

title: Talk:Alfred North Whitehead