Template:Prereq: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Intermediate save with new parameters)
(Should be working now. Layout could be improved though)
 
Line 1: Line 1:
{| 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;"
{| 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: {{{articles|}}}{{{areas|}}}{{{skills|}}}|s|}}'''</big>{{-}}
| <big>Article with '''prerequisite{{#if: {{{articles|}}}{{{areas|}}}{{{skills|}}}|s|}}'''</big>
{{#if: {{{article|}}}{{{articles|}}}{{{area|}}}{{{areas|}}}{{{skill|}}}{{{skills|}}}  <!-- Are there any prerequisites given? -->
{{#if: {{{article|}}}{{{articles|}}}{{{area|}}}{{{areas|}}}{{{skill|}}}{{{skills|}}}  <!-- Are there any prerequisites given? -->
  |  <!-- Yes, there are prerequisites given -->
  |  <!-- Yes, there are prerequisites given -->
   ''This article will be easier to understand if you have'' {{#if: {{{article|}}}{{{articles|}}}
   ''This article may be easier to understand if you'' <!--
  |   <!-- Reading one or more articles required -->
  --> {{#if: {{{article|}}}{{{articles|}}}  <!-- Are reading one or more articles required -->
     ''previously read and understood the following {{#if: {{{articles|}}} | articles: | article:}}''{{-}}
  |
<big>{{#if: {{{articles|}}} | {{{article}}}, | {{{article}}} }} {{{articles|}}}</big>{{-}}
     ''have previously read and understood the following {{#if: {{{articles|}}} | articles: | article:}}'' <!--
  }}{{#if: {{{area|-}}}{{{areas|}}}
    --> {{-}}<big>{{#if: {{{articles|}}} | {{#if: {{{article|}}}| {{{article}}}, }} {{{articles}}}| {{{article}}}}} </big>{{-}}
  | <!-- Knowledge in one or more areas required -->
  }}{{#if: {{{area|}}}{{{areas|}}}  <!-- Are knowledge in one or more areas required -->
    ''knowledge in the following {{#if: {{{areas|}}} | areas: | area:}}''{{-}}
  |
<big>{{#if: {{{areas|}}} | {{{area}}}, | {{{area}}} }} {{{areas|}}}</big>{{-}}
  ''{{#ifeq: {{{skill|}}}{{{skills|}}} | | {{#if: {{{article|}}}{{{articles|}}} | and }} }} knowledge in the following {{#if: {{{areas|}}} | areas: | area:}}'' <!-- Singular/plural? -->  <!--
   }}{{#if: {{{skill|}}}{{{skills|}}}
  -->{{-}}<big>{{#if: {{{areas|}}} | {{#if: {{{area|}}} | {{{area}}}, }} {{{areas}}} | {{{area}}} }}</big>{{-}}
  | <!-- One ore more kills are required -->
   }}{{#if: {{{skill|}}}{{{skills|}}}  <!-- Are one ore more skills required -->
     ''the following {{#if: {{{skills|}}} | skills: | skill:}}''{{-}}
  |
<big>{{#if: {{{skills|}}} | {{{skill}}}, | {{{skill}}} }} {{{skills|}}}</big>{{-}}
     ''{{#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 -->
  | <!-- No, there was no prerequisites given -->
   <big><big style="color: red;">Specify prerequisite</big></big>
   <big><big style="color: red;">Unspecified or incorrect parameter</big></big>
}}
}}
|}<includeonly>{{main other | [[:Category:Articles with prerequisites]]}}</includeonly><noinclude>
|}<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 25: 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>''articles='' <nowiki>|</nowiki>''area='' <nowiki>|</nowiki>''areas='' <nowiki>|</nowiki>''skill='' <nowiki>|</nowiki>''skills=''<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 refer to that before reading the article with the template the reader should preferable:
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.
; article, articles:  Have read one or more articles linked to.
Line 39: Line 56:


; skill, skills:      Have one or more skills.
; skill, skills:      Have one or more skills.
; nocat:              If non-empty pages will not be categorized.


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


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


}}
}}

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