Jump to content

Template:Infobox/doc: Difference between revisions

From WikiJournal
mNo edit summary
Tag: 2017 source edit
mNo edit summary
Tag: 2017 source edit
Line 1: Line 1:
== Instructions for using the Infobox template ==
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 [[Template:Gorge|gorges]], cities, rivers, etc.), ensuring a standardized appearance and structure.
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 [[Template:Mountain|mountains]], cities, rivers, etc.), ensuring a standardized appearance and structure.


=== Using Infobox in specialized templates ===
=== Using Infobox in specialized templates ===

Revision as of 14:35, 16 February 2025

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>
<noinclude>
{{documentation}}
</noinclude>

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.