FANDOM



Template documentation
Note: portions of the template sample may not be visible without values provided.
View or edit this documentation. (About template documentation)
Editors can experiment in this template's sandbox and test case pages.

This item is used as a helper template for the Template:BlockGallery is can only be used in a gallery context.

Parameters

The gallery item supports both optional link and text parameters. Through simple logic it determines what to write.

Parameter Description Default value
1 The first parameter described the image. Even though this is an unnamed parameter it is recommended to use it as a named parameter. This means that you would use the "1=" syntax.
link A for the caption and the image itself. empty
text A text value for the caption. When used in combination with the link parameter, the links text will change to this value. empty

Indented script version

{{{1}}} | 
{{#if: {{{link|}}} 
        | '''[[ {{{link}}} {{!}}
                {{#if: {{{text|}}} 
                    | {{{text}}}
                    | {{{link|}}}
                }}
        ]]'''{{!}} link={{{link|}}}
        | {{{text|}}} 
}}

Example

This example will use Template:BlockGallery to generate the different gallery items.

{{BlockGallery|1=
    {{BlockGalleryItem|1=Lancelot.png|text='''Caption lancelot image'''}}
    {{BlockGalleryItem|1=Lancelot.png|link=Template:BlockGalleryItem|text=Redirect to this same page.}}
}}
Community content is available under CC-BY-SA unless otherwise noted.