Difference between revisions of "Template:Footer Infobox"
From Captain of Industry Wiki
m |
(Added {{Navbox/Vehicles}} invoke) |
||
(23 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
so that we won't have to edit 100+ articles if some new widely-used paragraphs in articles appear. | so that we won't have to edit 100+ articles if some new widely-used paragraphs in articles appear. | ||
Edit with caution and look into documentation first.** | Edit with caution and look into documentation first.** | ||
** Direct trading and contracts fetch. ** | ** Direct trading and contracts fetch. ** | ||
-->{{#ifeq: {{#var: game_object_type}} | material |<!-- | -->{{#ifeq: {{#var: game_object_type}} | material |<!-- | ||
** todo | ** todo: ** | ||
-->|}}<!-- | -->|}}<!-- | ||
** Recipe fetch. ** | ** Recipe fetch. ** | ||
Storing the result first, to check if the header is needed. ** | |||
-->{{#ifeq: {{#var: game_object_type}} | material |<!-- | -->{{#ifeq: {{#var: game_object_type}} | material |<!-- | ||
-->{{recipe fetch|dir=out}} <!-- | -->{{#vardefine: fetched_data_1 | {{recipe fetch|dir=out}} }}<!-- | ||
--> | -->{{#vardefine: fetched_data_2 | {{recipe fetch|dir=in}} }}<!-- | ||
-->|}}<!-- | -->|}}<!-- | ||
-->{{#ifeq: {{#var: game_object_type}} | building |<!-- | -->{{#ifeq: {{#var: game_object_type}} | building |<!-- | ||
-->{{recipe fetch|isbldg=yes}}<!-- | -->{{#vardefine: fetched_data_1 | {{recipe fetch|isbldg=yes}} }}<!-- | ||
-->|}}<!-- | -->|}}<!-- | ||
** Displaying a header if needed, and then displaying generated data. | |||
Note intended line breaks, made for proper transclusion of headers.** | |||
-->{{#if: {{#var: fetched_data_1}} | {{Recipe fetch header}}  | |||
{{#var: fetched_data_1}} |}}<!-- | |||
-->{{#if: {{#var: fetched_data_2}} | {{Recipe fetch header}}  | |||
{{#var: fetched_data_2}} |}}<!-- | |||
** Technical check of data definition inside any article ** | ** Technical check of data definition inside any article ** | ||
Line 32: | Line 35: | ||
** Footer navigation boxes ** | ** Footer navigation boxes ** | ||
-->{{#ifeq: {{#var: game_object_type}} | building |<!-- | -->{{#ifeq: {{#var: game_object_type}} | material |<!-- | ||
-->{{Navbox/Materials}}|<!-- | |||
--> | -->{{#ifeq: {{#var: game_object_type}} | building |<!-- | ||
-->{{Navbox/Machines}}|<!-- | |||
-->{{#ifeq: {{#var: game_object_type}} | vehicle |<!-- | |||
-->{{Navbox/Vehicles}}<!-- | |||
-->|}}<!-- | |||
-->}}<!-- | |||
-->}}<!-- | |||
-->}}<!-- end of game_object_type check. | -->}}<!-- end of game_object_type check. |
Latest revision as of 09:47, 3 May 2023
Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]
This template is used on 200+ pages. Please, avoid large scale disruption and edit with extra care. |
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:
- Paragraphs related to usage within trading system (this is planned, not constructed yet).
- Recipe fetching and drawing (see Template:Recipe fetch and Template:Recipe draw).
- Footer navigation boxes.
- Technical checks (example Template:Footer Cargo).
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.)
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.)