Module:Infobox/doc: Difference between revisions

From Fanon Wiki
(Created page with "This module allows the creation of infoboxes in a very flexible and easy way with colors and ways of spliting cells. <big>'''This module is not intended to be invoked if it's not a template'''</big> ==How to use== <pre> {{#invoke:infobox|main|color=MAIN COLOR|text=TEXT COLOR|title=TITLE| Head / Content / Mode Head / Content / Mode Head / Content / Mode ... }} </pre> * '''MANDATORY:''' <code>main</code> — '''the first parameter will always need to be <code>main</...")
 
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
This module allows the creation of infoboxes in a very flexible and easy way with colors and ways of spliting cells.
This module allows the creation of infoboxes in a very flexible and easy way with colors and ways of spliting cells.
<big>'''This module is not intended to be invoked if it's not a template'''</big>


==How to use==
==How to use==
<pre>
<pre>
{{#invoke:infobox|main|color=MAIN COLOR|text=TEXT COLOR|title=TITLE|
{{#invoke:infobox|main|color=MAIN COLOR|text=TEXT COLOR|title=TITLE|
Head / Content / Mode
Head // Content // Mode
Head / Content / Mode
Head // Content // Mode
Head / Content / Mode
Head // Content // Mode
...
...
}}
}}
Line 25: Line 23:
<div class="infodemo">
<div class="infodemo">
{{#invoke:infobox|main|color=gold|text=#000|title=My title|
{{#invoke:infobox|main|color=gold|text=#000|title=My title|
Head / Content
Head // Content
Head / Content
Head // Content
Head / Content
Head // Content
Head / Content
Head // Content
Head / Content
Head // Content
}}
}}
</div>
</div>
<pre>
<pre>
{{#invoke:infobox|main|color=gold|text=#000|title=My title|
{{#invoke:infobox|main|color=gold|text=#000|title=My title|
Head / Content
Head // Content
Head / Content
Head // Content
Head / Content
Head // Content
Head / Content
Head // Content
Head / Content
Head // Content
}}
}}
</pre>
</pre>
Line 50: Line 48:
<div class="infodemo">
<div class="infodemo">
{{#invoke:infobox|main|color=turquoise|text=#fff|title=Modes of the infobox|
{{#invoke:infobox|main|color=turquoise|text=#fff|title=Modes of the infobox|
Split row / Split row / split
Split row // Split row // split
Wide row / Wide row / wide
Wide row // Wide row // wide
Image row / Image row / img
Image row // Image row // img
Unset row / Unset row
Unset row // Unset row
Wide row / Wide row / wide
Wide row // Wide row // wide
}}
}}
</div>
</div>
Line 61: Line 59:
<pre>
<pre>
{{#invoke:infobox|main|color=turquoise|text=#fff|title=Modes of the infobox|
{{#invoke:infobox|main|color=turquoise|text=#fff|title=Modes of the infobox|
Split row / Split row / split
Split row // Split row // split
Wide row / Wide row / wide
Wide row // Wide row // wide
Image row / Image row / img
Image row // Image row // img
Unset row / Unset row
Unset row // Unset row
Wide row / Wide row / wide
Wide row // Wide row // wide
}}
}}
</pre>
</pre>

Latest revision as of 20:18, 8 July 2022

This module allows the creation of infoboxes in a very flexible and easy way with colors and ways of spliting cells.

How to use

{{#invoke:infobox|main|color=MAIN COLOR|text=TEXT COLOR|title=TITLE|
Head // Content // Mode
Head // Content // Mode
Head // Content // Mode
...
}}
  • MANDATORY: mainthe first parameter will always need to be main, otherwise the infobox invokation will fail.
  • MANDATORY: TITLE — the title of the infobox.
  • Optional: color — the main color of the infobox, for the borders and the background of the title and heads.
  • Optional: text — the text color. Set to black (#000000) by default. If needed to change, it's recommended to use white (#ffffff) in the majority of cases.

After that, break a line and start the rows. Each new line break (on the editor) will create a new row.

  • MANDATORY: Head — the title of that row, the "header cell". It's the part that stays colored and text-centered.
  • MANDATORY: Content — the actual content of that row. It's the part that is not colored.
  • Optional: Mode — the mode of the row. See more below.
My title
Head
Content
Head
Content
Head
Content
Head
Content
Head
Content
{{#invoke:infobox|main|color=gold|text=#000|title=My title|
Head // Content
Head // Content
Head // Content
Head // Content
Head // Content
}}

Row modes

Each row can be assigned a "Mode", which is the way the row is split between cells. There are 3 available modes:

  • split — split the Head and Content horizontally, with the Content being somewhat larger.
  • wide — does not split the Head and Content, so they will take 100% of the width of that row.
  • img — similar to wide, but intended for images, usually placed at the top of the infobox. This takes out the background color of the Head so you can place the file there. The Content cell then is text-centered and italicized.
Modes of the infobox
Split row
Split row
Wide row
Wide row
Image row
Image row
Unset row
Unset row
Wide row
Wide row

Modes are optional. If the mode is omitted (like the "Unset row" above), then it will default to split.

{{#invoke:infobox|main|color=turquoise|text=#fff|title=Modes of the infobox|
Split row // Split row // split
Wide row // Wide row // wide
Image row // Image row // img
Unset row // Unset row
Wide row // Wide row // wide
}}