Extension:Semantic Result Formats/gallery format

The result format gallery, part of the Semantic Result Formats extension, displays query results as dynamic galleries with output which is the same as when using MediaWiki's built-in   tag.

Parameters
Semantic Gallery also respects the following parameters (which mean the same as they do when using them with the   tag):
 * perrow: to define how many thumbnails are shown in each row of the gallery,
 * heights: to set the maximum height (in pixels) of the thumbnails, and
 * widths: to set the maximum width of each thumbnail.
 * autocaptions: by default when you do not provide a caption, the image name will be used. Set this parameter to 'off' to prevent this.

Query
You can create a gallery either by querying image pages, or by querying the names of images as a property.

Querying image pages
To generate a simple gallery of all images in the 'Photographs' category, you could use the following:

If you query a property for the image pages, it'll be used as caption.

External sites with examples

 * Event pages on the 0x20 wiki: wikitext - result
 * Hardhoutbeleggingen Wiki - A Dutch-language wiki about hardwood investments. (Example page)
 * Timber Investments Wiki - An English-language version of the same. (Example page)

Querying image names as properties
If you have one or more pages that have multiple 'Has image' or similar properties, you can use the gallery format to display the images pointed by these properties. You need to specify which property contains the image names: imageproperty, and can optionally specify one that contains the captions: captionproperty.

This example will get you a gallery of images from pages in the events category:

This example will show images from the current page with their captions:

To-do

 * Do something intelligent when the inline query has no results.
 * Do something intelligent when the inline query has more results than the "limit" parameter allows.