mediawikisidebar

How do you make infoboxes in MediaWiki?


I'm making a wiki using MediaWiki. I've seen a right side bar of each page on other wikis.

The right side bar has information about the thing that the wiki post explains or what ever.

Example screenshot of what I want:

https://minecraft.fandom.com/wiki/Diamond_Ore

enter image description here

I want to know if it's possible to make that on each page, and how?


Solution

  • Most Wikipedia Infoboxes are just tables, with a right side float and some additional style, colors, etc.

    Minimal Infobox example

    Here a minimal example floating table with 1 column (and 1 row):

    {| style="float:right; border:1px solid black; width:270px"
    | My fantastic infobox
    |-
    | More info
    |}
    

    To understand that syntax, read the official documentation:

    https://www.mediawiki.org/wiki/Help:Tables

    Example Infobox with Image

    You may be surprised that, this infobox is just a table with two columns and some rows:

    Infobox preview

    Here the code:

    {| style="float:right; border:1px solid black; width:270px"
    !colspan="2" | Fantastic Page
    |-
    !colspan="2" | [[File:Example image.svg|260px]]
    |-
    ! Info
    | Stuff
    |-
    ! More Info
    | More Stuff
    |-
    ! And Info
    | Again Stuff
    |}
    

    Useful extra information:


    Note: this is OK for the presentational side, but for the content side one should also carefully think where to store the actual data. Especially if you want to create a wiki farm. Possibilities include standard wikitext/template syntax, SemanticMediaWiki, Wikibase.