Tardis:Preloadable formats: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
Line 11: Line 11:


==Notes to administrators==
==Notes to administrators==
The system works because of javascript code which isn't editable by most users.  However, the actual page formats ''are'' editable and work like this:
===Basic functionality===
The system works because of javascript code which shouldn't be touched.  However, the actual page formats ''are'' freely editable and work like this:
*The actual format is stored in files following the nomenclature '''Template:<format>/preload'''.  Thus they are ''subpages'' — though, technically they don't need the main page (that is, '''Template:<format>''') to exist.  Let's imagine you wanted to create a format for '''Locations on Skaro'''.  '''Don't do it''', but imagine.  You would have to type up the barebones format and place it on a page called [[Template:Locations on Skaro/preload]].   
*The actual format is stored in files following the nomenclature '''Template:<format>/preload'''.  Thus they are ''subpages'' — though, technically they don't need the main page (that is, '''Template:<format>''') to exist.  Let's imagine you wanted to create a format for '''Locations on Skaro'''.  '''Don't do it''', but imagine.  You would have to type up the barebones format and place it on a page called [[Template:Locations on Skaro/preload]].   
*The format is placed into the dropdown menu by editing [[Template:Stdpreloads]].  If you wanted to place your new format in the drop-down, you'd have to find the "Locations" section and then add "-- Locations on Skaro".  The name must exactly match that part of the title between the colon (:) and the slash (/).
*The format is placed into the dropdown menu by editing [[Template:Stdpreloads]].  If you wanted to place your new format in the drop-down, you'd have to find the "Locations" section and then add "-- Locations on Skaro".  The name must exactly match that part of the title between the colon (:) and the slash (/).
*When creating new templates, '''do not''' attempt place the template within a category.  '''Everything''' you place on the template will be transferred over to a new page when a user selects that template — including any attempts to put the template itself into a category.  Any categories on the template page should be ones you intend for articles using that template to be in.  For instance for the template, [[:template:Confidential/preload|Confidential/preload]], you ''want'' to make sure [[:category:Doctor Who Confidential episodes]] is on the template, so that pages which use it will end up in that category.  You can also visit [[:category:preload templates]] for a differently-worded explanation of this issue.  
===How to use categories with preload templates===
====Don't ''intentionally'' put the template itself in a category====
When creating new preload templates, '''do not''' attempt place the template within a category.  '''Everything''' you place on the template will be transferred over to a new page when a user selects that template — including any attempts to put the template itself into a category.  Thus, the traditional coding of
<pre>
<noinclude>[[category:Preload templates]]</noinclude>
</pre>
will result in every page that uses the preload template being assigned to [[:category:preload templates]].  This is clearly not desirable.  Fortunately, as [[:category:preload templates]] makes clear, these preload templates don't actually ''need'' to be in a category to be easily findable.
====Don't ''inadvertently'' put the templates in categories====
Any categories on the template page should be ones you intend for articles using that template to be in.  For instance for the template, [[:template:Confidential/preload|Confidential/preload]], you ''want'' to make sure [[:category:Doctor Who Confidential episodes]] is on the template, so that pages which use it will end up in that category.   
 
However, this will mean that the template page itself gets placed within the [[:category:Doctor Who Confidential episodes]].  Using the converse coding to the above situation,
<pre>
<includeonly>[[category:Doctor Who Confidential episodes]]</includeonly>
</pre>
'''will''' keep the template out of the category — but it will also keep any pages that use the template out of the category, as well.  This is not desirable, either.
====Templates out of categories, articles in====
What we want is coding that will keep the template un-categorized, but will allow the pages that use the category to be fully categorized.  We therefore have to build an exception into the programming, using an #ifeq statement.  What we'll say is that ''if'' the PAGENAME is equal to the template pagename, then nothing happens, but ''otherwise'' put the category on.  Hence:
<pre>
{{#ifeq:{{PAGENAME}}|Template:Confidential/preload
||
[[category:Doctor Who Confidential episodes]]}}
 
so
 
{{if the pagename is equal to|Template:Confidential/preload
|| <do nothing, indicated by nothingness between the two pipes>
else, slap on the category}}
</pre>
 
You can also visit [[:category:preload templates]] for a less technical explanation of this issue.  


[[category:TARDIS Index File Wiki]]
[[category:TARDIS Index File Wiki]]

Revision as of 07:02, 12 February 2011

Tardis:Help

Preloadable formats can greatly speed the process of writing an article from scratch. When you start a new article, you're given a choice at the top of the page to preload a format. You can either choose one from the drop-down menu, or you can enter a page name in the input box to the right. Doing either will ensure that you're making pages about similar subjects look the same across the wiki. It will also save you a great deal of time.

Option 1: the drop-down menu

You'll probably want to start your page with a skeleton format. This will allow you the greatest flexibility in writing. So we've prepared a series of formats for you to use across a wide variety of articles. Of course, all our formats are just rough guides. Sometimes, you have more information than what the pre-set format allows for; sometimes you have less. You'll therefore need to tailor the format to fit the amount of information you have. Nevertheless, the pre-set formats give you a good starting point from which to build your article. Just pull down the menu and select the one you want.

Option 2: the input box

Though most occasions will likely call for the use of the drop-down menu in order to select a "bare bones" format, there are times where it may be more convenient to copy over a fully-formed page, and then make minor adjustments. This can be done by entering the exact name of a page which already exists, and then pressing insert. Let's say that you were doing a series of Doctor Who Adventures issues and they all had basically the same content, except for minor variations. You'd start with, say, DWA Issue 56 and get that ready as the generic template for the next 10 issues. Then, you'd start a new page for DWA Issue 57 and type "DWA Issue 56" into the entry box under the number 2. The entire contents of DWA Issue 56 would then spring up on DWA Issue 57. You could then make a few changes before pressing submit and moving on to DWA Issue 58. The savings in keystrokes — at least to anyone who's ever worked on such pages — is obvious.

Need a new template?

We've tried to include a wide range of preloadable formats. However, if you think there's a need for a new format, please contact an administrator with your suggestion.

Notes to administrators

Basic functionality

The system works because of javascript code which shouldn't be touched. However, the actual page formats are freely editable and work like this:

  • The actual format is stored in files following the nomenclature Template:<format>/preload. Thus they are subpages — though, technically they don't need the main page (that is, Template:<format>) to exist. Let's imagine you wanted to create a format for Locations on Skaro. Don't do it, but imagine. You would have to type up the barebones format and place it on a page called Template:Locations on Skaro/preload.
  • The format is placed into the dropdown menu by editing Template:Stdpreloads. If you wanted to place your new format in the drop-down, you'd have to find the "Locations" section and then add "-- Locations on Skaro". The name must exactly match that part of the title between the colon (:) and the slash (/).

How to use categories with preload templates

Don't intentionally put the template itself in a category

When creating new preload templates, do not attempt place the template within a category. Everything you place on the template will be transferred over to a new page when a user selects that template — including any attempts to put the template itself into a category. Thus, the traditional coding of

<noinclude>[[category:Preload templates]]</noinclude>

will result in every page that uses the preload template being assigned to category:preload templates. This is clearly not desirable. Fortunately, as category:preload templates makes clear, these preload templates don't actually need to be in a category to be easily findable.

Don't inadvertently put the templates in categories

Any categories on the template page should be ones you intend for articles using that template to be in. For instance for the template, Confidential/preload, you want to make sure category:Doctor Who Confidential episodes is on the template, so that pages which use it will end up in that category.

However, this will mean that the template page itself gets placed within the category:Doctor Who Confidential episodes. Using the converse coding to the above situation,

<includeonly>[[category:Doctor Who Confidential episodes]]</includeonly>

will keep the template out of the category — but it will also keep any pages that use the template out of the category, as well. This is not desirable, either.

Templates out of categories, articles in

What we want is coding that will keep the template un-categorized, but will allow the pages that use the category to be fully categorized. We therefore have to build an exception into the programming, using an #ifeq statement. What we'll say is that if the PAGENAME is equal to the template pagename, then nothing happens, but otherwise put the category on. Hence:

{{#ifeq:{{PAGENAME}}|Template:Confidential/preload
||
[[category:Doctor Who Confidential episodes]]}}

so

{{if the pagename is equal to|Template:Confidential/preload
|| <do nothing, indicated by nothingness between the two pipes>
else, slap on the category}}

You can also visit category:preload templates for a less technical explanation of this issue.