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..."
 
infobox
Line 1: Line 1:
<noinclude>{{Infobox
<table class="infobox" style="
| title = Example Infobox
  border:1px solid {{{border-color|#aaa}}};
| content = <p> The content of an '''Infobox''' is just regular WikiText! </p>
  background: {{{background-color|#f9f9f9}}};
| width = 100px
  width: {{{width|300px}}};
  font-size:90%;
  font-family:sans-serif;
  clear: {{{clear|none}}};
">
  <tr>
    <th colspan="2" style="
      background: {{{title-background-color|#ccc}}};
      color: {{{title-text-color|#000}}};
      text-align:center;
      font-size:1.2em;
      padding:0.3em;
    ">
      {{{title|}}}
    </th>
  </tr>
  {{#if:{{{image|}}}
    | <tr>
        <td colspan="2" style="text-align:center; padding:0.4em;">
          [[File:{{{image}}}|250px|alt={{{image_alt|}}}]]
          {{#if:{{{image_caption|}}}
            |<div style="font-size:0.85em; font-style:italic; margin-top:0.3em;">{{{image_caption}}}</div>
          }}
        </td>
      </tr>
  }}
  {{#if:{{{type|}}}
    | <tr>
        <td style="font-weight:bold; width:110px; padding:0.2em;">Type</td>
        <td style="padding:0.2em;">{{{type}}}</td>
      </tr>
  }}
  {{#if:{{{date|}}}
    | <tr>
        <td style="font-weight:bold; padding:0.2em;">Date</td>
        <td style="padding:0.2em;">{{{date}}}</td>
      </tr>
  }}
  {{#if:{{{location|}}}
    | <tr>
        <td style="font-weight:bold; padding:0.2em;">Location</td>
        <td style="padding:0.2em;">{{{location}}}</td>
      </tr>
  }}
  {{#if:{{{domain|}}}
    | <tr>
        <td style="font-weight:bold; padding:0.2em;">Domain</td>
        <td style="padding:0.2em;">
          {{#if:{{{domain_url|}}}
            | [{{{domain_url}}} {{{domain}}}]
            | {{{domain}}}
          }}
        </td>
      </tr>
  }}
  {{#if:{{{website|}}}
    | <tr>
        <td style="font-weight:bold; padding:0.2em;">Website</td>
        <td style="padding:0.2em;">[{{{website}}} {{{website}}}]</td>
      </tr>
  }}
  {{#if:{{{description|}}}
    | <tr>
        <td colspan="2" style="padding:0.3em; font-size:0.9em; line-height:1.2em;">{{{description}}}</td>
      </tr>
  }}
  {{#if:{{{retired|}}}
    | <tr>
        <td style="font-weight:bold; padding:0.2em;">Retired</td>
        <td style="padding:0.2em;">{{{retired}}}</td>
      </tr>
  }}
  {{#if:{{{author|}}}
    | <tr>
        <td style="font-weight:bold; padding:0.2em;">Author</td>
        <td style="padding:0.2em;">{{{author}}}</td>
      </tr>
  }}
  {{#if:{{{version|}}}
    | <tr>
        <td style="font-weight:bold; padding:0.2em;">Version</td>
        <td style="padding:0.2em;">{{{version}}}</td>
      </tr>
  }}
</table>
 
<nowiki>
{{Infobox
| title                  = Colorful Example Infobox
| image                  = Example.jpg
| image_alt              = An example image
| image_caption          = Caption for example image
| type                  = Software Project
| date                  = 2025-07-10
| location              = Internet
| domain                = example.com
| domain_url            = https://example.com
| website                = https://example.com
| description            = This is a colorful infobox with customizable colors and width.
| retired                = No
| author                = Jane Doe
| version                = 1.0.0
| border-color          = #4A90E2
| background-color      = #E6F0FA
| title-background-color = #357ABD
| title-text-color      = #FFFFFF
| width                  = 350px
| clear                  = right
}}
}}
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.
</nowiki>
==How to use the <code><nowiki>{{Infobox}}</nowiki></code> template==
* width: CSS width property
* clear: CSS clear property
* background-colour: CSS background colour for Infobox title
* text-colour: CSS text colour for Infobox title
* border-colour: CSS border colour for Infobox.
* title: title for the Infobox
* content: content for the Infobox
==Tips==
* Separate blocks of text using the <code>&lt;p&gt;</code> tag.
* If you want to include an image, put it at the very beginning of <code>content</code>.
* The stylesheet is [[/styles.css|here]].
</noinclude><includeonly><templatestyles src="Infobox/styles.css"/><nowiki/>
  <div class="ec-infobox" style="border-color: {{{border-colour}}}; clear: {{{clear}}}"}}>
    <div class="ec-infobox-title" style="background-color: {{{background-colour|}}}; color: {{{text-colour|}}}">{{{title}}}</div>
    <div class="ec-infobox-content" style="width: {{{width}}}; aspect-ratio: {{{aspect-ratio}}}">{{{content}}}</div>
  </div><nowiki/>
</includeonly>

Revision as of 08:58, 10 July 2025

{{Infobox | title = Colorful Example Infobox | image = Example.jpg | image_alt = An example image | image_caption = Caption for example image | type = Software Project | date = 2025-07-10 | location = Internet | domain = example.com | domain_url = https://example.com | website = https://example.com | description = This is a colorful infobox with customizable colors and width. | retired = No | author = Jane Doe | version = 1.0.0 | border-color = #4A90E2 | background-color = #E6F0FA | title-background-color = #357ABD | title-text-color = #FFFFFF | width = 350px | clear = right }}