GSoC/GCI Archive
Google Code-in 2014 Wikimedia Foundation

Handle Template:Multiple_image in MediaViewer

completed by: m4tx

mentors: Gergő Tisza

MediaViewer displays images with associated metadata on top of wiki pages. When the user clicks on a thumbnail in an article, MediaViewer relies on the structure of the HTML code generated by MediaWiki's thumbnail handling code to find the caption and display it along with the image.

MediaWiki provides a template system through which editors can develop their own HTML conventions. The English Wikipedia uses a template called Multiple image to display multiple thumbnails in a single box. This results in HTML code very similar to normal thumbnails but with the captions located differently; this confuses MediaViewer and it sometimes displays the wrong caption.

The task is to fix that by adapting the HTML processing code in MediaViewer's mmv.bootstrap module. You can use the images on the template page and its talk page to test whether it works correctly. Note that there are multiple ways the template can be formatted (images placed vertically and horizontally, separate caption for each image or a common caption) and they should all work. If you need small changes in the template (such as an identifying classname), you can ask for them on the template talk page.

This is T85354 in Wikimedia's issue tracker.

Students are required to read Wikimedia's general instructions first.