Module:Galeria/doc
More actions
This is the documentation page for Module:Galeria
This module gets all parameters from the parent template of G, creates the attributes and values, and passes them to the gallery tag.
The mainly invoker is template:{{G}}.
The template G itself does nothing than to invoke this module, it does not specify any own parameters.
The module analyzes these parameters. In special, the unnamed parameter(s) can contain an unlimited number of items.
First of all the contents of all unnamed parameters are concatenated to one string:
- line 17…19 concatenates all pipe-separated items and separates them by ACK
- line 20 changes also the newline separators to ACK separators.
Then (line 22…35) when the parameter for 'format' is not specified, but
- a second parameter exists (after a pipe), and
- the first parameter is preceded by a newline, and
- the second parameter does not specify a file name,
- the first parameter is preceded by a newline, and
- then the format parameter is defaulted to the value "2".
Using the ACK instead of the slash "/" tolerates items containing slashes, as URL web addresses.
For the format 2, pairs of items are built, with possible defaulting of the description item.
Finally the total amount of items is passed to the Template:{{G/layout}}, together with the other parameters.
Because the gallery tag does not support the suppression of the showfilename option,
two transclusions of the gallery tag are necessary - one with, and the other one without showfilename.
A small function "converse" gets a size parameter (possible formats: 100, 150px, 200x240, 220x250px, x260, x280px)
and returns the widths and/or the heights values.