Template:Prereq: Difference between revisions
m (fix) |
(Should be working now. Layout could be improved though) |
||
(6 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: | {| 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: {{{ | | <big>Article with '''prerequisite{{#if: {{{articles|}}}{{{areas|}}}{{{skills|}}}|s|}}'''</big> | ||
'' | {{#if: {{{article|}}}{{{articles|}}}{{{area|}}}{{{areas|}}}{{{skill|}}}{{{skills|}}} <!-- Are there any prerequisites given? --> | ||
{{#if: {{{ | | <!-- Yes, there are prerequisites given --> | ||
|} | ''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: | 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> | ||
; article: | 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 == | == Examples == | ||
<nowiki>{{prereq|Howto:Multiplayer}}</nowiki> | <nowiki>{{prereq |article=[[Howto:Multiplayer]]}}</nowiki> | ||
{{prereq|Howto:Multiplayer | {{prereq |article=[[Howto:Multiplayer]] |nocat=true}} | ||
{{prereq|$FG HOME|$FG ROOT | <nowiki>{{prereq |articles=[[$FG HOME]], [[$FG ROOT]], [[$FG AIRCRAFT]] and [[$FG SCENERY]]}}</nowiki> | ||
{{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 |
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: |
{{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: |