Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Gallery Section: Difference between revisions

Template page
(add count_all parameter; show nothing if count_all is 0 (OR if the Master Gallery's calculated variable is 0))
m (escape extra " in captions that could break the html)
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
| {{#vardefine:COUNT| {{{count_all|0}}} }}  
| {{#vardefine:COUNT| {{{count_all|0}}} }}  
| {{#vardefine:COUNT|{{#var:{{#var:THREE}}}}}}
| {{#vardefine:COUNT|{{#var:{{#var:THREE}}}}}}
}}COUNT:{{#var:COUNT}}<!--
}}<!--
-->{{#ifeq: 0 | {{#var:COUNT}}
-->{{#ifeq: 0 | {{#var:COUNT}}
  |<!-- do nothing if no images -->
  |<!-- do nothing if no images -->
Line 20: Line 20:
     |format=gallery
     |format=gallery
     |autocaptions=no
     |autocaptions=no
     |captionproperty=?Caption
     |captionproperty={{#replace:?Caption|"|\"}}
     |widths={{{widths|250}}}
     |widths={{{widths|250}}}
     |limit={{{limit|10000}}}
     |limit={{{limit|10000}}}

Latest revision as of 00:37, 10 March 2021

Documentation icon Template documentation[view] [edit] [history] [purge]

Description

A helper/sub-template of Template:Master Gallery.

Creates a section header with the specified depth (h2, h3, h4, h5), and a gallery of all images that contain the two specified tags. If there are no images in the specified gallery, this code will not do anything. (That is, it is safe to call even when "Kagura Mutsuki" does not have images in the category "XBlaze" -- an extraneous "XBlaze" header will not appear on Kagura's gallery page.)

Template Usage

{{ Gallery Section
  | Kagura Mutsuki  <-- {{{1}}} Image category 1 (this must be the CHARACTER'S NAME)
  | Main Artwork    <-- {{{2}}} Image category 2
  |                 <-- {{{3}}} Image Category 3 (optional)
  | h2              <-- {{{4}}} Header depth (h2, h3, h4, h5)
  | Main Artwork    <-- {{{5}}} Section header (optional, will default to {{{2}}} )

  | widths = optional gallery widths (defaults to 250) 
  | limit = optional number of items returned from the #ask query (defaults to 10000)
}}

ie. {{ Gallery Section | Kagura Mutsuki | Main Artwork | | h2 }}
ie. {{ Gallery Section | Kagura Mutsuki | Chrono Phantasma | Story | h3 | Chrono Phantasma }}

Named parameters (widths, limit) need to come after unnamed ones (positional ones) like the categories and header depth.