Help:Infobox picture

From Embroidery Machine WIKI
Jump to navigation Jump to search

{{#invoke:Sidebar|sidebar}}

If an article already has an infobox at the top right, then the usual place for the article's first picture is within the infobox. This page describes how to add this picture. Confusingly, the proper syntax to do this varies from one infobox to another.

This page assumes that the picture has already been uploaded to Wikipedia or to Wikimedia Commons; see Wikipedia:Uploading images.

Using three or four parameters

In these infoboxes, the image information is split up into three or four different parameters. This is the syntax used by {{Infobox person}}, {{Infobox officeholder}}, {{Infobox sportsperson}} and others. Here are the image parameters for {{Infobox person}}:

{{Infobox person
| image                     = 
| image_size                = 
| alt                       = 
| caption                   = 
}}
  • image is the name of the image, abc.jpg, xpz.png, 123.gif, etc. Do not include the File: or Image: prefix, do not enclose the name in [[brackets]], but do remember to include the filename extension.
  • image_size should normally be left blank, so that the size defaults to the size set in a user's preferences.
  • alt should be set to a description of the image for visually impaired readers. See WP:ALT. Do not use this for another copy of the caption or of the article title, as the reader will already be aware of these.
  • caption, if set, displays just below the image. Remember that the person's name is typically displayed just above the image anyway, so only include a caption if it has something extra to say. It may be helpful to include the date or place of the photo.

Example

{{#invoke:Infobox|infobox}}{{#switch:

 {{#if: 
 | {{{demospace}}}    
 | {{#ifeq:Help|
   | main
   | other
   }} 
 }}

| main = {{#if:|{{#ifeq:Help||}}}}{{#if:|}}{{#if:|{{#if:|}}}}{{#if:|}}{{#if:|}}{{#if:|}}

| other | #default = }}

{{Infobox person
|name=Jimmy Wales
|image=Jimmy Wales Fundraiser Appeal edit.jpg
|caption=Wales in December 2008
}}

A real example would have other parameters as well.

Variations

Some infoboxes use a syntax similar to this, but with different names for the parameters. For example, {{Infobox album}} uses "Cover" instead of "image" and "Caption" instead of "caption".

Using one or two parameters

In these infoboxes, the image information is combined into only one or two parameters. This is the syntax used by {{Infobox football club}}, {{Infobox military conflict}} and others. Here are the image parameters for {{Infobox football club}}:

{{Infobox football club
| image                     =
| caption                   = 
}}
  • image is a complete image placement specification as described in the Picture tutorial or at Wikipedia:Extended image syntax. The size should typically be set to 200px, and the image should be centred. Alt text should be included for visually impaired readers.
  • caption is displayed below the image.

Example

{{#invoke:Infobox|infobox}}{{#ifeq:{{{kit}}}|image

|

}}

{{Infobox football club
|clubname    = Infobox Rovers
|image       = [[File:Football.svg|200px|center|alt=A white football with black pentagons]]
|caption     = The logo introduced in 2006
}}

Troubleshooting

I can't work out which set of parameters to use

When you edit the article, you should be able to find the text "{{Infobox" somewhere near the top. That line, without the pair of curly brackets, is the name of the infobox (If there's a vertical bar "|", then stop before that).

If you've found "Infobox connector", as an example, then type "Template:Infobox connector" into the Wikipedia search box to display the template definition and documentation.

The template documentation is unclear or missing

It happens. When you are on the template definition page, select "What links here" from within the Toolbox section on the left-hand side. This displays a list of articles that use the same infobox; some of these may help you work out what to do.

My image is displayed, but with extra square brackets and other nonsense

{{#invoke:Infobox|infobox}} This typically happens when "image = [[File:.....]]" is used within an infobox that expects "image = just the name".

{{Infobox chef
|name    = Example chef
|image   = [[File:William Orpen Le Chef de l'Hôtel Chatham, Paris.jpg|200px|center]] <!-- Error -->
|caption = A typical result from this kind of error
}}

My image is displayed, but is inside an extra frame

{{#invoke:Infobox|infobox}}{{#switch:

 {{#if: 
 | {{{demospace}}}    
 | {{#ifeq:Help|
   | main
   | other
   }} 
 }}

| main = {{#if:|{{#ifeq:Help||}}}}{{#if:|}}{{#if:|{{#if:|}}}}{{#if:|}}{{#if:|}}{{#if:|}}

| other | #default = }}

This occurs when the "thumb" keyword is included in the file specification.

{{Infobox person
|name    = Example chef
|image   = [[File:William Orpen Le Chef de l'Hôtel Chatham, Paris.jpg|200px|thumb|center]] <!-- Error -->
|caption = A typical result from this kind of error
}}

I'm seeing the image name as plain black text

{{#if:

|

}}
}} {{#if:the Thirty Years' War | }}{{#if:Battle of Lutzen.jpg | }}{{#if: |{{#if: |}}{{#if: |}} }}{{#if: |{{#if: |}}{{#if: |}} }}{{#if: |{{#if: |}}{{#if: |}} }}{{#if: |{{#if:| }}{{#if: |}} }}{{#if: |{{#if: |}}{{#if: |}} }}{{#if: |{{#if: |}} }}{{#if: |{{#if: |}} }}{{#if: |{{#if: |}} }}{{#if: ||{{#if: | }}}}{{#if: |{{#if: |}} }}{{#if: ||{{#if: | }}}}{{#if: | }}{{#if: | }}{{#if: |
Battle of Lützen
Part of the Thirty Years' War
Battle of Lutzen.jpg{{#if:A typical result from this kind of error|
A typical result from this kind of error}}
{{#if: | }}{{#if: | }}{{#if: |}}
Date {{{date}}}
Location Near Lützen, southwest of Leipzig{{#if:{{#if:Near Lützen, southwest of Leipzig|{{#if:|1}}}}|
}}
{{#if:|Status|Result}} {{#if:|{{{status}}}|{{{result}}}}}
Territorial
changes
{{{territory}}}
{{#if:||Belligerents}}
{{{combatant2}}} {{{combatant3}}}
{{{combatant2a}}} {{{combatant3a}}}
{{{combatant2b}}} {{{combatant3b}}}
{{{combatant2c}}} {{{combatant3c}}}
{{{combatant2d}}} {{{combatant3d}}}
Commanders and leaders
Units involved
Strength
{{{strength3}}}
Casualties and losses
{{{casualties3}}}
{{{notes}}}
Template:Location map

This may be because you have used the "image = just the name" syntax within an infobox that expects "image = [[File:.....]]".

{{Infobox military conflict
|conflict    = Battle of Lützen
|partof      = the [[Thirty Years' War]]
|image       = Battle of Lutzen.jpg  <!-- Error -->
|caption     = A typical result from this kind of error
|place       = Near [[Lützen, Germany|Lützen]], southwest of [[Leipzig]]
}}

My edits to a parameter are ignored

This could be a sign that the parameter name is not one of those recognized by the infobox that you are using. You should also check that the parameter is not being specified more than once, as only the last mention of a parameter has any effect.

I'm still stuck

Ask a question at the Wikipedia:Help desk, including the names of the article and the image.

See also