Template:Infobox: Difference between revisions

From Foxwells Wiki
Jump to navigation Jump to search
Created page with "<noinclude>{{Infobox | title = Example Infobox | content = <p> The content of an '''Infobox''' is just regular WikiText! </p> | width = 100px }} The Infobox template allows you to create boxes with arbitrary content which float at the right side of an article. This is useful for adding illustrations, tables, and asides without disrupting the flow of the main text. ==How to use the <code><nowiki>{{Infobox}}</nowiki></code> template== * width: CSS width property * clear: C..."
 
m add ckear
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{Infobox
<noinclude>{{Infobox
| title = Example Infobox
| title = Example Infobox
| content = <p> The content of an '''Infobox''' is just regular WikiText! </p>
| image = Example.jpg
| width = 100px
| image_alt = An example image
| image_caption = Caption goes here
| content = <p>The content of an '''Infobox''' is just regular WikiText!</p>
| width = 250px
}}
}}
The Infobox template allows you to create boxes with arbitrary content which float at the right side of an article. This is useful for adding illustrations, tables, and asides without disrupting the flow of the main text.
This template creates a styled infobox with customizable colors and flexible content.
==How to use the <code><nowiki>{{Infobox}}</nowiki></code> template==
 
* width: CSS width property
== Parameters ==
* clear: CSS clear property
* `title`: Title of the infobox
* background-colour: CSS background colour for Infobox title
* `image`: (Optional) Filename of an image (must be uploaded)
* text-colour: CSS text colour for Infobox title
* `image_alt`: Image alt text
* border-colour: CSS border colour for Infobox.
* `image_caption`: (Optional) Text shown below the image
* title: title for the Infobox
* `content`: The main content (use paragraphs, images, etc.)
* content: content for the Infobox
* `width`: CSS width (e.g., `300px`)
==Tips==
* `aspect-ratio`: (Optional) CSS aspect-ratio for content box
* Separate blocks of text using the <code>&lt;p&gt;</code> tag.
* `border-colour`: Border color of the box
* If you want to include an image, put it at the very beginning of <code>content</code>.
* `background-colour`: Background color of the title
* The stylesheet is [[/styles.css|here]].
* `text-colour`: Text color of the title
</noinclude><includeonly><templatestyles src="Infobox/styles.css"/><nowiki/>
* `clear`: CSS `clear` property (e.g., `right`, `left`)
  <div class="ec-infobox" style="border-color: {{{border-colour}}}; clear: {{{clear}}}"}}>
</noinclude><includeonly><templatestyles src="Infobox/styles.css"/>
    <div class="ec-infobox-title" style="background-color: {{{background-colour|}}}; color: {{{text-colour|}}}">{{{title}}}</div>
<div class="ec-infobox" style="border-color: {{{border-colour|#aaa}}}; float: {{{float|right}}}; clear: {{clear|none}};">
    <div class="ec-infobox-content" style="width: {{{width}}}; aspect-ratio: {{{aspect-ratio}}}">{{{content}}}</div>
  <div class="ec-infobox-title" style="background-color: {{{background-colour|#ccc}}}; color: {{{text-colour|#000}}}">
  </div><nowiki/>
    {{{title}}}
  </div>
  {{#if:{{{image|}}}
  |<div class="ec-infobox-image" style="text-align:center; margin-top:0.5em;">
    [[File:{{{image}}}|{{{width|250px}}}|alt={{{image_alt|}}}]]
    {{#if:{{{image_caption|}}}|<div style="font-size:0.85em; font-style:italic;">{{{image_caption}}}</div>}}
  </div>
  }}
  <div class="ec-infobox-content" style="width: {{{width|250px}}}; aspect-ratio: {{{aspect-ratio|auto}}}">
    {{{content}}}
  </div>
</div>
</includeonly>
</includeonly>

Latest revision as of 09:30, 10 July 2025

   Example Infobox
    An example image
Caption goes here

The content of an Infobox is just regular WikiText!

This template creates a styled infobox with customizable colors and flexible content.

Parameters

  • `title`: Title of the infobox
  • `image`: (Optional) Filename of an image (must be uploaded)
  • `image_alt`: Image alt text
  • `image_caption`: (Optional) Text shown below the image
  • `content`: The main content (use paragraphs, images, etc.)
  • `width`: CSS width (e.g., `300px`)
  • `aspect-ratio`: (Optional) CSS aspect-ratio for content box
  • `border-colour`: Border color of the box
  • `background-colour`: Background color of the title
  • `text-colour`: Text color of the title
  • `clear`: CSS `clear` property (e.g., `right`, `left`)