Help:Multiple image uploads

Jump to: navigation, search
Semantic extension(s): Semantic MediaWiki · Semantic Forms
Further extension(s):  -/-
Keyword(s): file management · file upload · images


In order for multiple images uploading to work properly, the Template page must indicate the property for the image field (for example: Property:Photos). However, this will often conflict with the proper display of that image. For example, [[Photos::Image:Test.jpg]] sets the property correctly but does not display the image.

The solution is to create two arraymaps. One sets the property, while the other displays the image. The template definition looks something like this:

{{#arraymap:{{{Images|}}}|,|x|[[Photos::x| ]]| }} <!-- Sets the property while displaying nothing -->
{{#arraymap:{{{Images|}}}|,|x|[[Image:x]]}} <!-- Displays the image -->

Displaying multiple images in an infobox

Here's how to display multiple images, each in its own row, inside an infobox:

{{#arraymap:{{{Images|}}}|,|x|[[Photos::x| ]]| }}
{{#arraymaptemplate:{{{Images|}}}|Imagerow|,| }}

And in Template:Imagerow:

{{!}}colspan="2" style="text-align:center;"{{!}}
[[Image:{{{1}}}|270px| ]]

Where Template:! contains | and Template:!- contains |-

This should obviously be customized to fit your infobox.

See also