Jump to content

Template:Infobox

From WikiJournal
Revision as of 12:40, 25 April 2022 by Philip (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
[view] [edit] [history] [update]
(i) Documentation

The Infobox template is a universal base template designed for creating information boxes in wiki articles. It serves as the foundation for specialized infoboxes (e.g., for gorges, cities, rivers, etc.), ensuring a standardized appearance and structure.

Using Infobox in specialized templates

To create a new infobox for a specific type of object, you need to use the Infobox template within your own template, passing the appropriate parameters.

  • {{Infobox ... }} — includes the base infobox.
  • title, image, description, header color — are passed directly to Infobox.
  • parameters — contains a list of fields that will be displayed if provided in the template (e.g., country, region).

Creating a new infobox based on Infobox

To create a new infobox (for example, for a city), follow the structure below and adjust the list of parameters for the desired object. Example structure for a city infobox:

<includeonly>
{{Infobox
 | title = {{{city name|}}}
 | image = {{{photo|}}}
 | description = {{{description|}}}
 | header color = #87CEEB
 | parameters = 
    {{#if:{{{country|}}} | <div class="infobox-row">
        <div class="infobox-label">Country:</div> 
        <div class="infobox-value">[[{{{country}}}]]</div>
    </div> }}
    {{#if:{{{population|}}} | <div class="infobox-row">
        <div class="infobox-label">Population:</div> 
        <div class="infobox-value">{{{population}}}</div>
    </div> }}
}}
</includeonly>

Additional parameters

When creating templates based on {{Infobox}}, you can add additional parameters for inserting maps, links to thematic portals and other sections at your discretion:

{{#if:{{{map|}}} | <div class="infobox-map">{{{map}}}</div> }}
    
{{#if:{{{portal|}}} | 
    <div class="infobox-section" style="background:#ffe2b8;">Thematic Portals</div>
    <div class="infobox-portal">{{{portal}}}</div>
}}

Now this template can be used in city articles as follows:

{{City
 | city name = Paris
 | photo = Paris.jpg
 | description = View of the Eiffel Tower
 | country = France
 | population = 2,165,423
}}

How to customize Infobox for your needs?

  1. Choose the type of object for which you need an infobox (city, river, nature reserve, etc.).
  2. Create a new template that uses Infobox as its base.
  3. Add the necessary parameters by passing them to the parameters section.
  4. Customize the infobox by changing the header color, adding new fields, and adjusting styles.


Only administrators can edit this page to escape any errors.