« Modèle:MetaInfobox/Chantier » : différence entre les versions

m
Simplification de DataResourceLoop
(Annulation des modifications 165 de Dailan (discussion))
Balises : Annulation Révoqué
m (Simplification de DataResourceLoop)
 
(47 versions intermédiaires par 3 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
<includeonly>{{#if:{{Data|{{PAGENAME}}|temporaire|}}|{{#ifeq:{{Data|{{PAGENAME}}|temporaire|}}|true|
<includeonly>
  {{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|evoluable}}|oui|
  <tr>
    <td align="center" colspan="2">{{MetaInline|Évolutions du jour|displayname=Évoluable}}</td>
  </tr>|}}
  {{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|temporaire}}|oui|
  <tr>
    <td align="center" colspan="2">{{MetaInline|Chantiers temporaires|displayname=Temporaire}}</td>
  </tr>|}}
  {{#if:{{Data|{{{nom|{{PAGENAME}}}}}|chantierParent}}|
  <tr>
    <td>'''Chantier parent :'''</td>
    <td align="right">{{MetaInline|{{Data|{{{nom|{{PAGENAME}}}}}|chantierParent}}}}</td>
  </tr>|}}
  {{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|typePlan}}|Commun|
  <tr>
    <td>'''Plan :'''</td>
    <td align="right">{{Cliquable|image=item_bplan_c.gif|link=Plans de chantier}}</td>
  </tr>|}}
  {{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|typePlan}}|Inhabituel|
  <tr>
    <td>'''Plan :'''</td>
    <td align="right">{{Cliquable|image=item_bplan_u.gif|link=Plans de chantier}}<!--
      -->{{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|planHotel}}|oui|{{Cliquable|image=item_mbplan_u.gif|link=Plan de chantier (inhabituel) (Hôtel)}}|}}<!--
      -->{{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|planHopital}}|oui|{{Cliquable|image=item_hbplan_u.gif|link=Plan de chantier (inhabituel) (Hôpital)}}|}}<!--
      -->{{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|planBunker}}|oui|{{Cliquable|image=item_bbplan_u.gif|link=Plan de chantier (inhabituel) (Bunker)}}|}}
    </td>
  </tr>|}}
  {{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|typePlan}}|Rare|
  <tr>
    <td>'''Plan :'''</td>
    <td align="right">{{Cliquable|image=item_bplan_r.gif|link=Plans de chantier}}<!--
      -->{{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|planHotel}}|oui|{{Cliquable|image=item_mbplan_r.gif|link=Plan de chantier (rare) (Hôtel)}}|}}<!--
      -->{{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|planHopital}}|oui|{{Cliquable|image=item_hbplan_r.gif|link=Plan de chantier (rare) (Hôpital)}}|}}<!--
      -->{{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|planBunker}}|oui|{{Cliquable|image=item_bbplan_r.gif|link=Plan de chantier (rare) (Bunker)}}|}}
    </td>
  </tr>|}}
  {{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|typePlan}}|Très rare|
  <tr>
    <td>'''Plan :'''</td>
    <td align="right">{{Cliquable|image=item_bplan_e.gif|link=Plans de chantier}}<!--
      -->{{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|planHotel}}|oui|{{Cliquable|image=item_mbplan_e.gif|link=Plan de chantier (très rare !) (Hôtel)}}|}}<!--
      -->{{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|planHopital}}|oui|{{Cliquable|image=item_hbplan_e.gif|link=Plan de chantier (très rare !) (Hôpital)}}|}}<!--
      -->{{#ifeq:{{Data|{{{nom|{{PAGENAME}}}}}|planBunker}}|oui|{{Cliquable|image=item_bbplan_e.gif|link=Plan de chantier (très rare !) (Bunker)}}|}}
    </td>
  </tr>|}}
  {{#if:{{Data|{{{nom|{{PAGENAME}}}}}|gainEau}}|
  {{#ifexpr: {{Data|{{{nom|{{PAGENAME}}}}}|gainEau}} > 0|
  <tr>
    <td>'''Gain en eau :'''</td>
    <td align="right">{{Data|{{{nom|{{PAGENAME}}}}}|gainEau}} {{Cliquable|image=item_water.gif|link=Puits}}</td>
  </tr>|}}|}}
  {{#if:{{Data|{{{nom|{{PAGENAME}}}}}|defense}}|
  {{#ifexpr: {{Data|{{{nom|{{PAGENAME}}}}}|defense}} > 0|
  <tr>
    <td>'''Défense :'''</td>
    <td align="right">{{Data|{{{nom|{{PAGENAME}}}}}|defense}} {{Cliquable|image=small_def.gif|link=Défenses}}</td>
  </tr>|}}|}}
  {{#if:{{Data|{{{nom|{{PAGENAME}}}}}|coutPA}}|
  <tr>
    <td>'''Coût :'''</td>
    <td align="right">{{Data|{{{nom|{{PAGENAME}}}}}|coutPA}} {{Cliquable|image=pa.gif|link=Point d'action}}</td>
  </tr>|}}
{{#if:{{Data|{{{nom|{{PAGENAME}}}}}|ressources}}|
  <tr valign="top">
  <tr valign="top">
  <td align="center" colspan="2">{{Temp}} [[Temporary buildings|Temporary]][[Category:Temporary buildings]]</td>
   <td style="white-space: nowrap; font-weight: bold;">Ressources :</td>
</tr>
   <td style="text-align:right">{{DataResourceLoop|{{{nom|{{PAGENAME}}}}}}}</td>
}}}}
  </tr>|}}
{{#if:{{Data|{{PAGENAME}}|upgradable|}}|{{#ifeq:{{Data|{{PAGENAME}}|upgradable|}}|true|
</includeonly><noinclude>__NOTOC__
<tr valign="top">
{{MetaInfobox}}
  <td align="center" colspan="2">{{MetaInline|Building upgrades|displayname=Upgradable}}[[Category:Upgradable buildings]]</td>
Ce sous modèle de [[Modèle:MetaInfobox|MetaInfobox]] permet d'afficher les informations spécifiques aux chantiers à partir de leur page [[:Catégorie:Data|Data]].
</tr>
}}}}
{{MetaInfobox/Category}}
{{#if:{{Data|{{PAGENAME}}|blueprint|}}|{{#ifeq:{{Data|{{PAGENAME}}|blueprint|}}|false|[[Category:Non-blueprint buildings]]|
<tr valign="top">
   <td style="white-space: nowrap; font-weight: bold;">{{MetaIcon|Blueprints}} Blueprint</td>
  <td>{{MetaIcon|Construction Blueprint ({{Data|{{PAGENAME}}|blueprint|none}})}} [[Construction Blueprint ({{Data|{{PAGENAME}}|blueprint|none}})|{{Data|{{PAGENAME}}|blueprint|none}}]][[Category:{{ucfirst:{{Data|{{PAGENAME}}|blueprint|none}}}} buildings]]</td>
</tr>
}}}}
{{#if:{{Data|{{PAGENAME}}|parent|}}|
<tr valign="top">
   <td style="white-space: nowrap; font-weight: bold;">{{Parent}} Parent building</td>
  <td>{{MetaInline|{{Data|{{PAGENAME}}|parent|none}}}}[[Category:Buildings unlocked by {{Data|{{PAGENAME}}|parent|none}}]]</td>
</tr>
}}
{{#if:{{Data|{{PAGENAME}}|defence|}}|{{#ifeq:{{Data|{{PAGENAME}}|defence|}}|0||
<tr valign="top">
  <td style="white-space: nowrap; font-weight: bold;">{{DP}} Defence[[Category:Defence buildings]]</td>
  <td>{{DP}} {{Data|{{PAGENAME}}|defence|0}}</td>
  </tr>
}}}}
<tr valign="top">
  <td style="white-space: nowrap; font-weight: bold;">{{AP}} Action Points cost</td>
  <td>{{AP}} {{Data|{{PAGENAME}}|ap|0}}</td>
</tr>
<tr valign="top">
  <td style="white-space: nowrap; font-weight: bold;">{{Res}} Resource cost</td>
  <td>{{DataResourceLoop|{{PAGENAME}}|{{Data|{{PAGENAME}}|resources|0}}}}</td>
</tr>
{{#ifexist:Category:Buildings unlocked by {{PAGENAME}}|
<tr valign="top">
  <td style="white-space: nowrap; font-weight: bold;">[[Image:item_lock.gif|link=Category:Building Tree]] Unlocks</td>
  <td>[[Image:small_parent.gif|link=Category:Building Tree]] [[:Category:Buildings unlocked by {{PAGENAME}}|See list]]</td>
</tr>
}}</includeonly><noinclude>
 
This template is a component of [[:Modèle:MetaInfobox]] used automatically when the category is set to buildings. The examples on this page focus on using MetaInfobox on Building pages this template should not be used directly. To add meta data to a page first add metainfobox to the page with the following:


<code><nowiki>{{MetaInfobox}}</nowiki></code>
[[Catégorie:Modèles de l’infoboîte]]


There should now be an infobox stub on the right of the page. Click the small 'c' to create the meta data, this will preload the correct data page with an outline for the basic data. Fill in the basics, you will then need to fill in extra fields depending on the category. For buildings see [[Data:MetaInfobox/Buildings]] for examples of the extra fields that are displayed on this page in the infobox example on the right.
</noinclude>
</noinclude>
1 623

modifications