Template:Footer Infobox: Difference between revisions

From Captain of Industry Wiki
Jump to: navigation, search
m minor copying error causing the recipes header to fail
m now it doesn't show up when there is no contract for the item
 
(5 intermediate revisions by the same user not shown)
Line 10: Line 10:


     ** Direct trading and contracts fetch. **
     ** Direct trading and contracts fetch. **
     -->{{#ifeq: {{#var: game_object_type}} | material |
     -->{{#ifeq: {{#var: game_object_type}} | material |<!--
      -->{{#vardefine: buy_contracts|{{Contracts fetch|dir=buy}}}}<!--
      -->{{#vardefine: sell_contracts|{{Contracts fetch|dir=sell}}}}<!--
      -->{{#if: {{#var:sell_contracts}} {{#var:buy_contracts}} |
<!--  -->==Contracts==
<!--  -->==Contracts==
<!--  -->Below are the contracts which are available for this item. These contracts are calculated for [[Cargo Ship|ships]] with size 8. Please note that these need to be unlocked by finding and upgrading the [[Villages]].<!--
<!--  -->Below are the contracts which are available for this item. These contracts are calculated for [[Cargo Ship|ships]] with size 8. Please note that these need to be unlocked by finding and upgrading the [[Villages]].
      -->{{#vardefine: buy_contracts|{{Contracts fetch|dir=buy}}}}
<!--  -->{{#vardefine: sell_contracts|{{Contracts fetch|dir=sell}}}}
<!--  -->{{#if: {{#var: buy_contracts}}|
<!--  -->{{#if: {{#var: buy_contracts}}|
<!--    -->=== Buy ===
<!--    -->=== Buy ===
Line 20: Line 21:
<!--  -->{{#if: {{#var: sell_contracts}}|
<!--  -->{{#if: {{#var: sell_contracts}}|
<!--    -->=== Sell ===  
<!--    -->=== Sell ===  
<!--    -->{{#var:sell_contracts}}}}<!--
<!--    -->{{#var:sell_contracts}}}}}}
    -->|}}<!--
<!---->|}}
<!--


     ** Recipe fetch. **
     ** Recipe fetch. **

Latest revision as of 21:07, 20 March 2026

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]

This template must be invoked on the bottom of every article, which is a game object. This generally refers to any article, which starts with the usage of any of the Infobox templates.

In other words, all items, machines, etc. must contain this at their footer.

Such a structure allows to mass-edit important (but uniform) parts of articles, without the need of manually editing each of them one by one.

Examples of what this template automatically takes care of:

The above text is transcluded from Template:Footer Infobox/doc; you can change it or view its history. (How does this work?)
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Please add categories and interwikis to Template:Footer Infobox/doc. (View all subpages of this page.)