Difference between revisions of "Template:ImageGallery"

From Bearscape Wiki
Jump to: navigation, search
(I might've got this working, going to find out...)
(Added usage information.)
Line 1: Line 1:
 
<ul class="gallery mw-gallery-traditional">
 
<ul class="gallery mw-gallery-traditional">
<!--<li class="gallerybox" style="margin-right: 5px">
 
<div style="width: 155px">
 
<div class="thumb" style="width: 155px; height: 155px">
 
<span class="plainlinks" style="display: block; width: 150px; height: 150px">[http://bearscape.org/commissions/cbxcommission.png <img src="http://bearscape.org/commissions/cbxcommission.png" style="max-width: 100%; max-height: 100%; margin: 77.5px; transform: translate(-50%, -50%)">]</span>
 
</div>
 
<div class="gallerytext">
 
TESTING BECAUSE FUCKING MEDIAWIKI BULLSHIT
 
</div>
 
</div>
 
</li>
 
<li class="gallerybox" style="margin-right: 5px">
 
<div style="width: 155px">
 
<div class="thumb" style="width: 155px; height: 155px">
 
<p style="width: 150px; height: 150px">
 
<span class="plainlinks" style="display: block; width: 150px; height: 150px">[http://lucca.cyberbotx.com/wallpaperbk/Awaiting_V__2_0___A_LESSON__D8_by_Saaally-d8d6met.png <img src="http://lucca.cyberbotx.com/wallpaperbk/Awaiting_V__2_0___A_LESSON__D8_by_Saaally-d8d6met.png" style="max-width: 100%; max-height: 100%; margin: 77.5px; transform: translate(-50%, -50%)">]</span>
 
</p>
 
</div>
 
<div class="gallerytext">
 
TESTING BECAUSE FUCKING MEDIAWIKI BULLSHIT
 
</div>
 
</div>
 
</li>-->
 
 
{{
 
{{
 
   #fornumargs: number
 
   #fornumargs: number
Line 27: Line 5:
 
   |{{
 
   |{{
 
     #ifexpr: {{#var: number}} mod 2
 
     #ifexpr: {{#var: number}} mod 2
     |<li class="gallerybox" style="margin-right: 5px">
+
     |<li class="gallerybox" style="margin-right: 10px">
 
<div style="width: 155px">
 
<div style="width: 155px">
 
<div class="thumb" style="width: 155px; height: 155px">
 
<div class="thumb" style="width: 155px; height: 155px">
Line 40: Line 18:
 
}}
 
}}
 
</ul>
 
</ul>
 +
<noinclude>
 +
This template is a replication of the built-in MediaWiki &lt;gallery&gt; tag, but meant to be used with external images only.
 +
 +
To utilize it, add the following to a page:
 +
 +
<pre>{{ImageGallery
 +
|URL1
 +
|COMMENT1
 +
|URL2
 +
|COMMENT2
 +
...
 +
|URLn
 +
|COMMENTn
 +
}}</pre>
 +
 +
You will need at least one URL and COMMENT combination for this to render properly. If you wish to have an image in the gallery not have a comment, then just leave the COMMENT empty, but do NOT exclude the pipe symbol.
 +
 +
An example gallery with this template:
 +
 +
<pre>{{ImageGallery
 +
|http://pixabay.com/static/uploads/photo/2014/10/10/22/07/sun-483984_640.jpg
 +
|A sunset
 +
|http://pixabay.com/static/uploads/photo/2012/04/26/19/47/penguin-42936_640.png
 +
|A penguin (''beware'')
 +
|http://pixabay.com/static/uploads/photo/2014/08/20/05/22/big-bang-422305_640.jpg
 +
|
 +
|http://pixabay.com/static/uploads/photo/2013/07/12/14/54/robot-148989_640.png
 +
|
 +
}}</pre>
 +
 +
(Notice how the last 2 URLs have no comments, but the | for the comment is still needed.)
 +
 +
Will render as follows:
 +
 +
{{ImageGallery
 +
|http://pixabay.com/static/uploads/photo/2014/10/10/22/07/sun-483984_640.jpg
 +
|A sunset
 +
|http://pixabay.com/static/uploads/photo/2012/04/26/19/47/penguin-42936_640.png
 +
|A penguin (''beware'')
 +
|http://pixabay.com/static/uploads/photo/2014/08/20/05/22/big-bang-422305_640.jpg
 +
|
 +
|http://pixabay.com/static/uploads/photo/2013/07/12/14/54/robot-148989_640.png
 +
|
 +
}}
 +
</noinclude>

Revision as of 22:22, 4 June 2015

This template is a replication of the built-in MediaWiki <gallery> tag, but meant to be used with external images only.

To utilize it, add the following to a page:

{{ImageGallery
|URL1
|COMMENT1
|URL2
|COMMENT2
...
|URLn
|COMMENTn
}}

You will need at least one URL and COMMENT combination for this to render properly. If you wish to have an image in the gallery not have a comment, then just leave the COMMENT empty, but do NOT exclude the pipe symbol.

An example gallery with this template:

{{ImageGallery
|http://pixabay.com/static/uploads/photo/2014/10/10/22/07/sun-483984_640.jpg
|A sunset
|http://pixabay.com/static/uploads/photo/2012/04/26/19/47/penguin-42936_640.png
|A penguin (''beware'')
|http://pixabay.com/static/uploads/photo/2014/08/20/05/22/big-bang-422305_640.jpg
|
|http://pixabay.com/static/uploads/photo/2013/07/12/14/54/robot-148989_640.png
|
}}

(Notice how the last 2 URLs have no comments, but the | for the comment is still needed.)

Will render as follows: