101: Templating

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

Your comprehensive guide to Templates on Uncyclopedia.

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.


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

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

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.

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

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:

Look what you can make with templates!

Here is some preliminary reading material:

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?

This is what the typical template looks like.

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

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

102: Basic Templates & Resources >>