Extension:CategoryGallery

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
CategoryGallery
Release status: beta
CategoryGallery.png
Implementation Tag
Description Allows to create a gallery of all images in a category
Author(s) Nathan Larson (Leucostictetalk)
Latest version 1.0.1 (2013-10-29)
MediaWiki 1.21+
PHP 5+
Database changes No
License GPL
Download
* <categorygallery>
Translate the CategoryGallery extension if it is available at translatewiki.net
Check usage and version matrix.

The CategoryGallery extension implements a <categorygallery> tag creating a gallery of all images in a category.

Installation[edit source]

  • Download and place the file(s) in a directory called CategoryGallery in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/CategoryGallery/CategoryGallery.php";
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage[edit source]

If you want to show a gallery of all images in category Foo, do this:

<categorygallery cat="foo"/>

You can abbreviate it as catgallery:

<catgallery cat="foo"/>

The categorygallery tag itself takes several additional parameters, specified as attribute name-value pairs:

<catgallery {parameters}/>
  • caption="{caption}": (caption text between double quotes for more than a word) sets a caption centered atop the gallery.
  • widths={width}px: sets the widths of the images, default 120px. Note the plural, widths
  • heights={heights}px: sets the (max) heights of the images.
  • perrow={integer}: sets the number of images per row. 0 means automatically adjust based on width of screen
  • showfilename={anything}: Show the filenames of the images in the individual captions for each image (1.17+)
  • bdpcaption={property}: Show the metadata of the images in the individual captions for each image (requires Extension:BedellPenDragon)

To see how to use this extension with Extension:BedellPenDragon to generate a CategoryGallery with captions generated from image description files, see Extension:BedellPenDragon#CategoryGallery with captions generated from image description files (requires CategoryGallery extension).

See also[edit source]