Template:Infobox: Difference between revisions

From Foxwells Wiki
Jump to navigation Jump to search
hate
death
Line 1: Line 1:
<includeonly>
<noinclude>{{Infobox
{| class="infobox" style="border:1px solid {{{border-color|#aaa}}}; background:{{{background-color|#f9f9f9}}}; width:{{{width|300px}}}; font-size:90%; font-family:sans-serif;"
| title = Example Infobox
|-
| image = Example.jpg
! colspan="2" style="background:{{{title-background-color|#ccc}}}; color:{{{title-text-color|#000}}}; text-align:center; font-size:1.2em; padding:0.3em;" | {{{title|}}}
| image_alt = An example image
{{#if:{{{image|}}}|
| image_caption = Caption goes here
|-
| content = <p>The content of an '''Infobox''' is just regular WikiText!</p>
| colspan="2" style="text-align:center;" | [[File:{{{image}}}|250px|alt={{{image_alt|}}}]]
| width = 250px
{{#if:{{{image_caption|}}}|<div style="font-size:0.85em; font-style:italic;">{{{image_caption}}}</div>}}
}}
}}
{{#if:{{{type|}}}|
This template creates a styled infobox with customizable colors and flexible content.
|-
 
| '''Type''' || {{{type}}}
== Parameters ==
}}
* `title`: Title of the infobox
{{#if:{{{date|}}}|
* `image`: (Optional) Filename of an image (must be uploaded)
|-
* `image_alt`: Image alt text
| '''Date''' || {{{date}}}
* `image_caption`: (Optional) Text shown below the image
}}
* `content`: The main content (use paragraphs, images, etc.)
{{#if:{{{location|}}}|
* `width`: CSS width (e.g., `300px`)
|-
* `aspect-ratio`: (Optional) CSS aspect-ratio for content box
| '''Location''' || {{{location}}}
* `border-colour`: Border color of the box
}}
* `background-colour`: Background color of the title
{{#if:{{{domain|}}}|
* `text-colour`: Text color of the title
|-
* `clear`: CSS `clear` property (e.g., `right`, `left`)
| '''Domain''' || {{#if:{{{domain_url|}}}|[{{{domain_url}}} {{{domain}}}]|{{{domain}}}}}
</noinclude><includeonly><templatestyles src="Infobox/styles.css"/>
}}
<div class="ec-infobox" style="border-color: {{{border-colour|#aaa}}}; clear: {{{clear|right}}}">
{{#if:{{{website|}}}|
  <div class="ec-infobox-title" style="background-color: {{{background-colour|#ccc}}}; color: {{{text-colour|#000}}}">
|-
    {{{title}}}
| '''Website''' || [{{{website}}} {{{website}}}]
  </div>
}}
  {{#if:{{{image|}}}
{{#if:{{{description|}}}|
  |<div class="ec-infobox-image" style="text-align:center; margin-top:0.5em;">
|-
    [[File:{{{image}}}|{{{width|250px}}}|alt={{{image_alt|}}}]]
| colspan="2" | {{{description}}}
    {{#if:{{{image_caption|}}}|<div style="font-size:0.85em; font-style:italic;">{{{image_caption}}}</div>}}
}}
  </div>
{{#if:{{{retired|}}}|
  }}
|-
  <div class="ec-infobox-content" style="width: {{{width|250px}}}; aspect-ratio: {{{aspect-ratio|auto}}}">
| '''Retired''' || {{{retired}}}
    {{{content}}}
}}
  </div>
{{#if:{{{author|}}}|
</div>
|-
| '''Author''' || {{{author}}}
}}
{{#if:{{{version|}}}|
|-
| '''Version''' || {{{version}}}
}}
|}
</includeonly>
</includeonly>

Revision as of 09:11, 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`)