Welcome to Warhammer 40k - Lexicanum! Log in and join the community.

Template:Gallery

From Warhammer 40k - Lexicanum
Jump to: navigation, search
[edit] [purge] Template-info.png Template documentation

Status

28/04/2023

  • functional
  • last-line centering bug resolved

Description

Flexible GALLERY template which essentially aligns thumbnail images in a centered grid. Compared to the <gallery> format, The advantages are :

  • no loss of space between images and their frame' borders, as opposed to the "normal" <gallery> format
  • no weird frameless appearance in the "packed" mode of the <gallery> format, on desktop browsers
  • description text is neatly tucked within the image frame, under the image

In mobile view, this template behaves like the "packed" mode of <gallery> (ie images with no frames and no backdrop), but it has the advantages of looking better in desktop view.

Parameters

MAX NUMBER OF IMAGES : 50

  • the |Size= parameter of the gallery controls the height of all the images globally
  • file: the name of the file hosted on the lexicanum
  • Size (image) : controls the height of an image, expressed in pixels / px, only the number is required.
    • The default size when no value is entered is 200px (height).
    • The recommended maximum size is 350 - anything beyond that value might make rectangular images go out of the frame of a page on the mobile version of the lexi, and create unwanted and un-ergonomic Scrollbars
    • each image can have its individual height changed, if the Gallery Size setting has not been entered. You can make image with a different ratio cohabit together
  • Description: text, links, footnotes

Format

With individual sizes for each image, and no global size
{{Gallery
|Size=
|file.jpg|size| description
|file.jpg|size| description
|file.jpg|size| description
 ...
|file.jpg|size| description
}}
With Global Size
{{Gallery
|Size=200
|file.jpg|| description
|file.jpg|| description
|file.jpg|| description
 ...
|file.jpg|| description
}}

Example 1 : varying sizes and shapes


Example 2 : <Gallery mode=packed> vs {{Gallery}} vs <Gallery>

<Gallery mode=packed> heights=150

{{Gallery}} heights=150


<Gallery> heights and widths=150

Code (Hidden)

  • Unknown.jpg