101: Templating

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search
AuntJemima.png
Welcome to Aunt Jemima's Templating Academy!

Your comprehensive guide to Templates on Uncyclopedia.

Bouncywikilogo.gif

For those without comedic tastes, the so-called experts at Wikipedia have an article about Wikipedia: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 to Templating

A Quick 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."

Jack klugman thinker.jpg
I've Been Thinking About Templating Stuff...

Maybe you should try it sometime... It's like a drug... It's awesome...

On second thought, maybe you shouldn't try to template stuff... Know what I mean?

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>.
Tip:
You can annoy people with templates and still avoid technically breaking any 'rules' by creating them in your userspace.

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 3 locations where templates might exist, lurking in the darkest recesses of Uncyclopedia, just waiting to suck: Template Namespace, Mainspace, and Userspace.

Cquote1.svgWe Don't Like Templates!Cquote2.svg

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.

For 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">

OnionRings.jpg
<insert name here> will work for food.
OnionRings.jpg

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 are transcluding templates within templates.

For 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.

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:
Aunt Jemima.jpg
I ain't Ja Mama, I ain't ya Sistah, I ain't ya Grand Mammy neither! I am Aunt Jemima and I coined that 'ol SOB!! Fo shizzle my nizzle Snoop Dogg ain't got nuthin on me!

And a template from your userspace:

{{:User:Zana Dark/Template}} looks like this:
JESUS.gif
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.

Frequently Asked Questions

Why Should I Care About Templating?

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 in Order to Enroll?

Gorillatrans.gif
HowTo
This article is part of Uncyclopedia's HowTo series.
See more HowTos

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:

Look what you can make with templates!!!

Here is some preliminary reading material:

How Much is Tuition?

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?

This is what the typical template looks like.

No, but there are 28 fabulous award templates and 6 honours that you can collect if you want to beat the game of Uncyclopedia and earn the Completionist Trophy for your userspace:

   5 Userboxen
+11 Sophia Awards
+ 8 Purple Nurple Awards
+ 4 AJTA Awards
+ 6 Order of Uncyclopedia Achievement Honours
----------------------------------------------------------------------
= Completionist Trophy

I Was Just Wondering... So, When Do Classes Start?

Now. Whenever you are ready. Enroll by clicking on the link below.

Enroll in the Academy

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 are not sure, ask to be adopted first.


Name Notes or Questions
Sir Codpiece ZOMG WTF BBQ!?!
Stranger195
Amdavis
Treehousesafety
Your name here...

When you are 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 Templateburg...

When you are ready to move on to the next lesson, click the link below:

102: Basic Templates & Resources >>