101: Templating
This project page is being considered for deletion in accordance with Uncyclopedia's deletion policy
This project page may not fit in Uncyclopedia, or may not be funny with little chance for redemption. Please share your thoughts on the matter at this project page's entry on the Votes for deletion page. |
If you want to understand how wiki templates actually work, see MediaWiki's help page or Wikipedia's help page on wiki templates. |
So, you want to know how to make templates like the hardcore editors on wiki sites, huh? Well I hope you brought your coding chops!
Introduction
Overview
A template allows you to reproduce infinite content inside a set structure with pre-defined rules and (hopefully) modifiable parameters.
When a template is used in wiki formatting, it is called "transclusion."
The content of a template or page can be added to another page by inserting the code: :{{X}}, where X is the name of the template without the Template: prefix, or the pagename preceded by a colon (:).
Whenever the pages used as templates are altered, all the pages that transclude those pages will change automagically.
Templates should be properly documented on their pages for people to understand how to use them, but must be coded properly so the instructions are not transcluded along with the template. Enclose whatever you do not want transcluded within the tags:
- <noinclude> DOCUMENTATION_AND_EXTRA_SPACING [[Category:Template Help|{{PAGENAME}}]]</noinclude>.
You may also use the tags:
- <includeonly> [[Category:X]] </includeonly> to assign a category to pages that transclude the template, or code that you want transcluded but not visible on the template page.
Confusing? You bet!
Don't worry, this is only the first lesson ...
Location, location, location
There are three locations where templates might exist, lurking in the darkest recesses of Uncyclopedia, just waiting to suck: Template Namespace, Mainspace, and Userspace.
“ | We Don't Like Templates! | ” |
Templates in the template namespace, are created with the Template: prefix and are supposed to be categorized into specific template types. Any page that begins with Template: can be inserted as a template, minus the prefix and surrounded by two curly braces.
Example
The template Template:WWFF is inserted like this:
- {{WWFF|{{USERNAME}}}}, and appears like magic:
<div id="" class="UBOX " style="display:table; text-align:center; float:<insert name here>; clear:none; margin:2px 5px; margin-<insert name here>:0; width:278px">
<insert name here> will work for food. |
but it looks like crap because right now it's not working very well. See how difficult this whole template thing is? Well, we DID warn you!
Can you believe it? But as explained previously, any page can be a template with the help of that colon you got there. The pipe character: | indicates the start of the first parameter passed to the template. You will learn more about coding for parameters later. In the meantime, you can just substitute GASSHOLE for USERNAME and see what happens. Hilarious.
If your article requires templates, it is recommended you create them in the mainspace as subpages of your article. On this page we use the template {{:Templating/Header}} to create the banner at the top of the page. Did you see it? You can't miss it.
Templates in your userspace are created as subpages of your username. If you haven't already, you can create your own template: {{:User:<insert name here>/Template}} right now!
Code substitution
Once you have made your own template, you can add {{subst:TEMPLATENAME}} to pages where you want the code itself substituted onto the page, and not just linked to the template. This can be handy for replicating code but it will no longer update automatically when the original template is altered.
We usually use the substitution method for welcome templates, because it gives nooberinos a chance to learn by example. There is also {{safesubst:TEMPLATENAME}}, in case you're transcluding templates within templates.
Example
This is a template within a template, but it doesn't require the safe substitution of code, and notice how the button says the opposite of what it's supposed to. Whoever sporked the code from Wikipedia is a moron, obviously. Oops, that was me.
Signatories(1-888) to the Uncyclopedia Legal Department, hereinafter referred to as this Department ;
Noting that Ministers on 6 January, 2010 agreed the Uncyclopedia round of lateral and asphyxiative Legal Negotiations should achieve the summary and ever-greater diminishing of falsifiable page editing, inter alia compus, the progressive dismantling of propriety and the improvement of the unintentional misconduct for the conduct of the purposes later to be defined;
Seeking to achieve maximum pay in office, inofficial payments for services rendered, including elimination of our duties, and to the fullest extent possible, the reduction or elimination of rights of the general public editing the Site;
Encouraging the non-continued legal support to any parties involved;
Desiring to provide unfair and unequal competitive opportunities for other editors than those directly involved with this Department;
Being mindful of the importance in the editing sector of nobody else's interests;
Knowing that many Signatories view the comedy sector as a particularly important component of the proceedings in Uncyclopedia;
Advocating the elimination of adversaries and the distortion of provided opinion;
Requiring that those not in favor of this Department operate on an unfair basis;
Wanting to not really represent the rights of anyone;
Recognizing the need to provide for uncyclopedically legalistic notification, consultation, severe surveillance and dubitable dispute settlement procedures with a view to ensuring a "fair, prompt and effective" enforcement of the provisions of this - or any other - Agreement and to maintain the balance of rights and obligations among nobody;
Establishing an international framework governing abnormal conduct and inappropriate laughter;
- 1.1 This Agreement applies to the following products:
- a) articles,
- b) talk pages thereof,
- c) all other parts, components, and sub-pages of articles, such as templates and userboxes
- d) all foreign life forms, kittens (huffed or otherwise), grues, mythological creatures and
- e) illicit sexual devices wielded by any given member of the community
- 1.2 For the purposes of this Agreement "articles" means:
- a) all articles other than locked articles and
- b) all other products set out in Article 1.1 above or elsewhere
T.I.T.S. (Things I Take Seriously)
- The documentation for the template should be on the template page.
- Templates that exist in the mainspace should be usable and adaptable.
- Leave the coding to the professionals: there are Template-making templates that you can use fairly easily, or you may request templates here.
If you don't fully understand how to make templates, please don't make any templates in the mainspace.
Inserting the code:
- {{Aunt Jemima}} looks like this:
And a template from your userspace:
- {{:User:Zana Dark/Template}} looks like this:
Let Me Tell You Something, Pendejo -
You pull any of your crazy shit with us, you flash a piece out on the lanes, I'll take it away from you, stick it up your ass and pull the fucking trigger 'til it goes "click."
|
Got it? Great!
Once again, welcome to Aunt Jemima's Templating Academy.
FAQ
Why should I care?
Templates make the standardization of tabular data and the inter-linking of wiki-based pages and websites both functional and easy to understand. When visually formatting information, templates can also be used to annoy stupid readers with obnoxious borders, colors, images and ideas.
Do I need to know anything special?
It helps to have a very good understanding of HTML and CSS. Hopefully you have already been adopted by the formatting genie or one of her post-grads. If not, you should probably do that first. Here are the fundamental articles that all seasoned editors should be familiar with:
- The Beginner's Guide
- About Uncyclopedia
- The Five Pliers of Uncyclopedia
- Everything You Ever Wanted to Know About Uncyclopedia, But Were Afraid to Ask
- How to be funny and not just stupid
- Our In-Jokes Page
- Our Vanity Policies
- Help Pages
- Formatting
Here is some preliminary reading material:
- Uncyclopedia Owner's Manual
- Templates Ahoy!
- The Life and Death of a Template
- USERNAME template abuse
How much?
Typically, the tuition can be paid for using your immortal soul. In the event that you have already sold your soul, you can either pay by cash, money order, or exchange of services. Please see your local financial counselor for details.
Will I ever get paid to make templates?
God, no. What?
No, but there are fabulous awards and honours to collect, not to mention the braging rights of a Completionist!
So ... When do classes start?
Now. Whenever you're ready. Enroll by clicking on the link below.
Enroll
Sign up by adding your info to the Class Roster. You really shouldn't sign up for this unless you've already mastered basic wiki editing. If you're not sure, ask to be adopted first.
Name | Notes or Questions |
---|---|
Sir Codpiece | ZOMG WTF BBQ!?! |
Stranger195 | |
Amdavis | |
Treehousesafety | |
Your name here... | |
Smuggler |
When you're ready to submit a template into the mainspace, leave a note on the Template Translation page at the bottom somewhere.
There is also the nomination feature at the top of this page that says "This Template Sucks!" Make sure you include the 'Template:' prefix (or userpage if applicable) and we will check it out.
Continue on the Amazing Journey to Template City ...
When you're ready to move on to the next lesson, click the link below: