Help:Adding Pages to Categories and Templates: Difference between revisions
(Created page with "==Introduction== Have you wondered why your new page has not shown up on the function/event page or other lists? Do you try to edit in a link to your page, only to notice weird t...") |
mNo edit summary |
||
Line 1: | Line 1: | ||
==Introduction== | ==Introduction== | ||
Did you create a new page, such as a function, and it isn't showing up in a list? Did you try and edit it in only to see <nowiki>{{weird_tags_like_this}}</nowiki> instead of text relating to the page you viewed? Welcome to the world of templates. We have noticed in [[Special:RecentChanges|RecentChanges]] that people are making pages and not linking to them properly. '''These pages are being lost in the bowels of the Wiki!''' | |||
We | We also use categories in this wiki, but they are not as crucial as templates. Please read on to learn about both and to understand how to contribute to our wiki properly. | ||
=Template= | =Template= | ||
==What is a Template== | |||
Its like a big copy paste on a clipboard. You write a template tag on another page and it writes everything that was on the template page. | |||
'''Why Use Templates?''' | |||
It allows the same information to be represented in multiple places, without duplicating texts and updating them manually numerous times. | |||
'''Example?''' | |||
Look at the page source (edit button) on our functions or event pages. You can see that the functions aren't actually listed there, each function group has its own template. The main use for this is to fill out the "See Also" section of individual functions with their related functions. | |||
==How Do You Make/Edit a Template?== | |||
The best way to teach | The best way to teach is by example. I will need a template to direct people to this guide from multiple pages in the wiki. Let's just create this template together! FUN! | ||
===1. Choosing a Template Name=== | |||
Think of a good name for your template. Your template will take the form of "{{My_Template}}" inside of other page sources where it is used. Therefore, the best template name is one that explains what the template is, without someone having to actually look at the template to figure it out. | Think of a good name for your template. Your template will take the form of <nowiki>"{{My_Template}}"</nowiki> inside of other page sources where it is used. Therefore, the best template name is one that explains what the template is, without someone having to actually look at the template to figure it out. | ||
Typically the best thing to do is make a template with the exact same name as the page. So I will use: | Typically the best thing to do is make a template with the exact same name as the page. So I will use: | ||
<syntaxhighlight lang="xml">{{ | <syntaxhighlight lang="xml">{{Adding_Pages_to_Categories_and_Templates}}</syntaxhighlight> | ||
'''''Important Note:''''' Just remember all pages are case sensitive. A page name in lowercase does not lead to the same page name in uppercase! Capitalize appropriately... | |||
If you did not make the template page yet but you linked to it, instead of it showing what is on the template page you get something like this: | If you did not make the template page yet but you linked to it, instead of it showing what is on the template page you get something like this: | ||
Line 35: | Line 36: | ||
http://wiki.multitheftauto.com/wiki/Template:Adding_pages_to_categories_and_templates | http://wiki.multitheftauto.com/index.php?title=Template:Adding_pages_to_categories_and_templates | ||
===2. Filling out the Template=== | |||
The first thing you do when you get to the new page is hit create page. This takes you to the 'edit' field box. | The first thing you do when you get to the new page is hit create page. This takes you to the 'edit' field box. | ||
Line 41: | Line 42: | ||
From here you type in whatever you want to be pasted in other pages. It could be simple text, links to a set of functions, or even as advanced as a bit of code that determines something. An advanced example would be the black boxes we use specify forthcoming functions. They are auto-managed through a template with a nifty piece of code that asks what the current version of MTA is. | From here you type in whatever you want to be pasted in other pages. It could be simple text, links to a set of functions, or even as advanced as a bit of code that determines something. An advanced example would be the black boxes we use specify forthcoming functions. They are auto-managed through a template with a nifty piece of code that asks what the current version of MTA is. | ||
From this point, you simply edit your template tag into the page. Again, it is the template name surrounded by two braces. So mine is <nowiki>{{ | From this point, you simply edit your template tag into the page. Again, it is the template name surrounded by two braces. So mine is <nowiki>{{Adding_Pages_to_Categories_and_Templates}}</nowiki> | ||
===3. Demonstration=== | |||
So here I will actually link to the template. If you check the template page you will see exactly what is printed below: | So here I will actually link to the template. If you check the template page source, you will see exactly what is printed below: | ||
{{ | {{Adding_Pages_to_Categories_and_Templates}} | ||
=Category= | =Category= | ||
Categories simply group pages together as they share a common bond. For example, all the client functions have a category. A page could be in multiple categories if you wish. Generally people have gotten this right even if they did not intend to, because the person copied a template from another page and edited it and left the category tag in. | Categories simply group pages together as they share a common bond. For example, all the client functions have a category. A page could be in multiple categories if you wish. Generally people have gotten this right even if they did not intend to, because the person copied a template from another page and edited it and left the category tag in. |
Revision as of 16:17, 6 August 2012
Introduction
Did you create a new page, such as a function, and it isn't showing up in a list? Did you try and edit it in only to see {{weird_tags_like_this}} instead of text relating to the page you viewed? Welcome to the world of templates. We have noticed in RecentChanges that people are making pages and not linking to them properly. These pages are being lost in the bowels of the Wiki!
We also use categories in this wiki, but they are not as crucial as templates. Please read on to learn about both and to understand how to contribute to our wiki properly.
Template
What is a Template
Its like a big copy paste on a clipboard. You write a template tag on another page and it writes everything that was on the template page.
Why Use Templates? It allows the same information to be represented in multiple places, without duplicating texts and updating them manually numerous times.
Example? Look at the page source (edit button) on our functions or event pages. You can see that the functions aren't actually listed there, each function group has its own template. The main use for this is to fill out the "See Also" section of individual functions with their related functions.
How Do You Make/Edit a Template?
The best way to teach is by example. I will need a template to direct people to this guide from multiple pages in the wiki. Let's just create this template together! FUN!
1. Choosing a Template Name
Think of a good name for your template. Your template will take the form of "{{My_Template}}" inside of other page sources where it is used. Therefore, the best template name is one that explains what the template is, without someone having to actually look at the template to figure it out.
Typically the best thing to do is make a template with the exact same name as the page. So I will use:
{{Adding_Pages_to_Categories_and_Templates}}
Important Note: Just remember all pages are case sensitive. A page name in lowercase does not lead to the same page name in uppercase! Capitalize appropriately...
If you did not make the template page yet but you linked to it, instead of it showing what is on the template page you get something like this:
Template:Broken template that doesnt exist yet but heres a link to make it lazy pants
So as you can see, it is better we create the template before attempting to link to it! "How do I create a template without linking to it first?!" I hear you shouting at the screen...
You simply type a URL of the page you would like the make. Using the name I decided upon above, my link is:
http://wiki.multitheftauto.com/index.php?title=Template:Adding_pages_to_categories_and_templates
2. Filling out the Template
The first thing you do when you get to the new page is hit create page. This takes you to the 'edit' field box.
From here you type in whatever you want to be pasted in other pages. It could be simple text, links to a set of functions, or even as advanced as a bit of code that determines something. An advanced example would be the black boxes we use specify forthcoming functions. They are auto-managed through a template with a nifty piece of code that asks what the current version of MTA is.
From this point, you simply edit your template tag into the page. Again, it is the template name surrounded by two braces. So mine is {{Adding_Pages_to_Categories_and_Templates}}
3. Demonstration
So here I will actually link to the template. If you check the template page source, you will see exactly what is printed below:
Category
Categories simply group pages together as they share a common bond. For example, all the client functions have a category. A page could be in multiple categories if you wish. Generally people have gotten this right even if they did not intend to, because the person copied a template from another page and edited it and left the category tag in.