Template:Prereq: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Created page with "{| class=toccolours align="center" style="text-align: center; width: 80%; font-size: 85%; clear:both; margin-top:1em; margin-bottom:-0.5em; border-left: 15px solid orange;" |...")
 
(Should be working now. Layout could be improved though)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class=toccolours align="center" style="text-align: center; width: 80%; font-size: 85%; clear:both; margin-top:1em; margin-bottom:-0.5em; border-left: 15px solid orange;"
{| class=toccolours align="center" style="text-align: center; width: 80%; font-size: 85%; clear:both; margin-top: 1em; margin-bottom: 0em; border-left: 15px solid orange;"
| <big>Article with '''prerequisite{{#if: {{{2|-}}}|s|}}'''</big>
| <big>Article with '''prerequisite{{#if: {{{articles|}}}{{{areas|}}}{{{skills|}}}|s|}}'''</big>
''Understanding this article will be easier if you previously have read and {{#if: {{{2|-}}} | understood the following articles: | understood:}}''{{-}}
{{#if: {{{article|}}}{{{articles|}}}{{{area|}}}{{{areas|}}}{{{skill|}}}{{{skills|}}}  <!-- Are there any prerequisites given? -->
{{#if: {{{1|}}} | [[{{{1}}}]] | <big style="color: red;">Add link to article</big> }}{{#if: {{{2|}}} | &bull; [[{{{2}}}]] }}{{#if: {{{3|}}} | &bull; [[{{{3}}}]] }}{{#if: {{{4|}}} | &bull; [[{{{4}}}]] }}{{#if: {{{5|}}} | &bull; [[{{{5}}}]] }}{{#if: {{{6|}}} | &bull; [[{{{6}}}]] }}{{#if: {{{7|}}} | &bull; [[{{{7}}}]] }}
|  <!-- Yes, there are prerequisites given -->
|}<includeonly>{{main other|[[Category:Articles with prerequisites]]}}</includeonly><noinclude>
  ''This article may be easier to understand if you'' <!--
  --> {{#if: {{{article|}}}{{{articles|}}}  <!-- Are reading one or more articles required -->
  |
    ''have previously read and understood the following {{#if: {{{articles|}}} | articles: | article:}}'' <!--
    --> {{-}}<big>{{#if: {{{articles|}}} | {{#if: {{{article|}}}| {{{article}}}, }} {{{articles}}}| {{{article}}}}} </big>{{-}}
  }}{{#if: {{{area|}}}{{{areas|}}}  <!-- Are knowledge in one or more areas required -->
  |
  ''{{#ifeq: {{{skill|}}}{{{skills|}}} | | {{#if: {{{article|}}}{{{articles|}}} | and }} }} knowledge in the following {{#if: {{{areas|}}} | areas: | area:}}''  <!-- Singular/plural? -->  <!--
  -->{{-}}<big>{{#if: {{{areas|}}} | {{#if: {{{area|}}} | {{{area}}}, }} {{{areas}}} | {{{area}}} }}</big>{{-}}
  }}{{#if: {{{skill|}}}{{{skills|}}} <!-- Are one ore more skills required -->
  |
    ''{{#if: {{{articles|}}}{{{article|}}}{{{area|}}}{{{areas|}}} | and }} have the following {{#if: {{{skills|}}} | skills: | skill:}}'' <!--
    -->{{-}}<big>{{#if: {{{skills|}}} | {{#if: {{{skill|}}} | {{{skill}}}, }} {{{skills}}} | {{{skill}}} }}</big>{{-}}
  }}
| <!-- No, there was no prerequisites given -->
  <big><big style="color: red;">Unspecified or incorrect parameter</big></big>
}}
|}<includeonly>
{{#if: {{{nocat|}}}
| <!-- {{{nocat}}} is not empty, do not categorize -->
|  <!-- {{{nocat}}} is empty or undefined -->
  {{#if:  <!-- Check namespaces used -->
  {{namespace detect
  | main  = 1
  | help  = 1
  | howto = 1
  }}
  | <!-- One of the namespaces was used, do categorize per prerequisites -->
  {{#if: {{{article|}}}{{{articles|}}} | [[:Category:Pages with reading prerequisites]] }} <!--
  -->{{#if: {{{area|}}}{{{areas|}}} | [[:Category:Pages with knowledge prerequisites]] }} <!--
  -->{{#if: {{{skill|}}}{{{skills|}}} | [[:Category:Pages with skill prerequisites]] }}
  }}
}}
</includeonly><noinclude>
{{Informative template|1=
{{Informative template|1=
__NOTOC__
__NOTOC__
Line 9: Line 42:
This template will advise the reader to first read through one or more articles and ''then'' continuing with the current article.
This template will advise the reader to first read through one or more articles and ''then'' continuing with the current article.


Adding this template to a page in the article namespace will automatically add [[:Category:Articles with prerequisites]] to that page.
Adding this template to a page in the article, Howto or Help namespace will automatically add the page to a subcategory to [[:Category:Pages with prerequisites]].  This can be suppressed by using a non-empty '''nocat''' parameter.


== Usage ==
== Usage ==
Put this template between the article text and any previous messageboxes.
Put this template between the article text and any previous messageboxes.


  <nowiki>{{</nowiki>'''prereq'''<nowiki>|</nowiki>article<nowiki>}}</nowiki>
  <nowiki>{{</nowiki>'''prereq''' <nowiki>|</nowiki>''article='' <nowiki>|</nowiki>''articles='' <nowiki>|</nowiki>''area='' <nowiki>|</nowiki>''areas='' <nowiki>|</nowiki>''skill='' <nowiki>|</nowiki>''skills='' <nowiki>|</nowiki>''nocat=''<nowiki>}}</nowiki>
 
All the parameters are optional and except for '''nocat''' refer to that before reading the page the reader should preferably:


<nowiki>{{</nowiki>'''prereq'''
; article, articles: Have read one or more articles linked to.
<nowiki>|</nowiki> article
<nowiki>|</nowiki> ''article''
<nowiki>|</nowiki> ''article''
<nowiki>|</nowiki> ''article''
<nowiki>|</nowiki> ''article''
<nowiki>|</nowiki> ''article''
<nowiki>|</nowiki> ''article''
  <nowiki>}}</nowiki>


; article: One to seven titles of articles the reader preferable should read before reading the article with the template.
; area, areas:       Have knowledge in one or more areas.
 
; skill, skills:      Have one or more skills.
 
; nocat:              If non-empty pages will not be categorized.


== Examples ==
== Examples ==
  <nowiki>{{prereq|Howto:Multiplayer}}</nowiki>
  <nowiki>{{prereq |article=[[Howto:Multiplayer]]}}</nowiki>
{{prereq|Howto:Multiplayer}}
{{prereq |article=[[Howto:Multiplayer]] |nocat=true}}


  <nowiki>{{prereq
  <nowiki>{{prereq |articles=[[$FG HOME]], [[$FG ROOT]], [[$FG AIRCRAFT]] and [[$FG SCENERY]]}}</nowiki>
| $FG HOME
{{prereq |articles=[[$FG HOME]], [[$FG ROOT]], [[$FG AIRCRAFT]] and [[$FG SCENERY]] |nocat=true}}
| $FG ROOT
| $FG AIRCRAFT
| $FG SCENERY
}}</nowiki>
 
{{prereq
| $FG HOME
| $FG ROOT
| $FG AIRCRAFT
| $FG SCENERY
}}


}}
}}

Latest revision as of 20:06, 22 August 2014

Article with prerequisite

Unspecified or incorrect parameter

The following template description is not displayed when the template is inserted in an article.

Goal

This template will advise the reader to first read through one or more articles and then continuing with the current article.

Adding this template to a page in the article, Howto or Help namespace will automatically add the page to a subcategory to Category:Pages with prerequisites. This can be suppressed by using a non-empty nocat parameter.

Usage

Put this template between the article text and any previous messageboxes.

{{prereq |article= |articles= |area= |areas= |skill= |skills= |nocat=}}

All the parameters are optional and except for nocat refer to that before reading the page the reader should preferably:

article, articles
Have read one or more articles linked to.
area, areas
Have knowledge in one or more areas.
skill, skills
Have one or more skills.
nocat
If non-empty pages will not be categorized.

Examples

{{prereq |article=[[Howto:Multiplayer]]}}
Article with prerequisite

This article may be easier to understand if you have previously read and understood the following article:
Howto:Multiplayer


{{prereq |articles=[[$FG HOME]], [[$FG ROOT]], [[$FG AIRCRAFT]] and [[$FG SCENERY]]}}
Article with prerequisites

This article may be easier to understand if you have previously read and understood the following articles:
$FG HOME, $FG ROOT, $FG AIRCRAFT and $FG SCENERY