Template:Commons-gallery

From Wikipedia, the free encyclopedia

See our image gallery on this topic at:
Commons-gallery
[edit] Template documentation

[edit] Usage

This template will link to a commons gallery page in several modes
(note how the bold text wraps to the template)
  1. of the same name as the pagename of the article, should the two match, this requires no parameters be passed:
    {{Commons-gallery}}

  2. If the gallery name is desired as given, this requires One parameter be passed: (use either {{{1}}} or |page=
       
    {{Commons-gallery|linkpage=Some gallery name}} or {{Commons-gallery|Some gallery name}}

  3. If the gallery name as given, but needs redirected to an English name equivalent. This requires two names be given as parameters, the second {{{2}}} will act as a pipetrick:
    {{Commons-gallery|Some gallery name|A Name in English}}
(This is most likely use... many foreign wikipedia's are far more active in building galleries than we English wikipedians.
It's almost as if most of us don't know Wikimedia Commons1 exists, and the naming guidelines, being a multilingual site, permit non-English names in all spaces outside of Commons:categories, which by fiat, are all in English. Thus many English 'gallery names' need defined as redirects.
(gallerys are in main namespace on the commons.

[edit] Optional parameters

The template also holds several named (option) parameters to change modes
  • 'ALTTEXT='Will supplant most of the boilerplate line with inserted text. The combined output will read: 'See our' {{{ALTTEXT}}} followed by the linkname, however it may be pipetricked. [This is especially useful for Commons Atlas collections, for which the link name provides its own title. ]
    • Define {{{2}}} as a 'colon', and you're likely done, as this selects "Atlas mode" and changes the boilerplate.

  • 'R=', standing for 'R'ight, which floats the template to the page right side, not the page left side as the default shown above. Right, right, and 'r' also work.
    Example: {{{Commons-gallery|galleryname}}
    This mode may also be selected using the parameter names 'right', 'r', and 'Right'.
  • 'C=1', (or 'c'), standing for 'C'ategory, which directs the link formed to Wikimedia Commons category namespaces. This is "inserted" in the link formation, and all other parameter modes are still in effect.

  • p=, if defined, will override any link's pipetrick and so gives total control of formatting the output taken together with ALTTEXT and or {{{2}}}. If {{{2}}} is "Atlas mode" (|2=:), the ouput pipetrick is not affected by .
  • HTML format parameters... width, padding, margin, align, and some other control parameters can be specified to change the appearance outside the default modes noted above. See the 'actual code' listed at the end of this usage page to see the options if you care and know a bit about HTML box structure formatting commands.
  • inhibit=something, if 'true' will inhibit auto-clearing, left or right, which may have a desired effect by wrapping text differently.

Examples
... starting with what not to do!
  • Example-1a: {{Commons-gallery| Saxony|c=1|R=1}} and {{Commons-gallery| flowers|pretty}} gives:
See our image gallery on this topic at:
pretty
See our image gallery on this topic at:
Saxony


:*Example-1b: Switching the order...
See our image gallery on this topic at:
Saxony
See our image gallery on this topic at:
pretty


  • Example-1c: [inhibit used] {{Commons-gallery| Saxony|c=1|R=1|inhibit=yes}} and {{Commons-gallery| flowers|inhibit=true}} gives:
See our image gallery on this topic at:
pretty
See our image gallery on this topic at:
Saxony




The moral of that story, is to use on same line, place in a wikitable
{{FixBunching|beg}} <!-- this merely begins a wikitable, the color is "transparent" -->
|{{Commons-gallery|Middle Ages}}
|{{Commons-gallery|R=1|Atlas of the medieval age|:|p=Atlas of the Middle Ages}}
|}
{{-}}

which gives:

See our image gallery on this topic at:
Middle Ages
See related thematic maps in our Atlas:
Atlas of the Middle Ages


  • Example-2: Test text wraps fine,... despite the above moralistic tale: {{Commons-gallery| Saxony|r=1}} giving:
See our image gallery on this topic at:
Saxony

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.



Atlas mode
ALTTEXT is undefined, {{{2}}} as ':', so stated as: {{Commons-gallery|Atlas of the medieval ages |R=1 |:}}
See related thematic maps in our Atlas:
Atlas of the medieval ages

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • Note the first link above used a pipetrick override to rename the displayed link, this example did not.