Wiktenauer logo.png

Difference between revisions of "Template:Image"

From Wiktenauer
Jump to navigation Jump to search
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><table style="border-collapse: collapse; caption-side: bottom; text-align: center; text-color: #000; height: 166px; width: 166px; float: left; margin: 0px 6px 6px 0px;">
+
<includeonly><table class="galleryhover" style="box-sizing: border-box; border-collapse: collapse; caption-side: bottom; text-align: center; text-color: #000; height: 166px; width: 166px; float: left; margin: 0px 6px 6px 0px;">
 
   <caption style="font-weight:normal;">{{{2|}}}</caption>
 
   <caption style="font-weight:normal;">{{{2|}}}</caption>
 
   <tr>
 
   <tr>
 
     <td style="padding:0.2em;">{{#if: {{{ph|}}}
 
     <td style="padding:0.2em;">{{#if: {{{ph|}}}
           | &#91;{{{1|}}}&#93;  
+
           | {{#if: {{{h|}}}
           | [[file:{{{1|}}}|{{{width|150x150px}}}|center{{#if: {{{link|}}}  
+
            | <table style="margin-left: auto; margin-right: auto;">
               | {{!}}link={{{link|}}}  
+
                <tr>
             }}{{#if: {{{page|}}}  
+
                  <td style="width: 146px; height: 98px; border: 1px solid #979fb0;"></td>
                 | {{!}}link=page:{{{1|}}}  
+
                </tr>
             }}{{#if: {{{red|}}}  
+
              </table>
                 | {{!}}link={{canonicalurl:{{urlencode:page:{{{1|}}}|wiki}}|action=edit&redlink=1}}  
+
            | {{#if: {{{sq|}}}
             }}]]  
+
                | <table style="margin-left: auto; margin-right: auto;">
 +
                  <tr>
 +
                    <td style="width: 118px; height: 118px; border: 1px solid #979fb0;"></td>
 +
                  </tr>
 +
                </table>
 +
                | <table style="margin-left: auto; margin-right: auto;">
 +
                  <tr>
 +
                    <td style="width: 98px; height: 146px; border: 1px solid #979fb0;"></td>
 +
                  </tr>
 +
                </table>
 +
              }}
 +
            }}
 +
           | [[file:{{{1|}}}|{{#if:{{{h|}}}|{{{width|150x125px}}}|{{#if:{{{sq|}}}|{{{width|150x150px}}}|{{{width|125x150px}}}}}}}|center{{#if:{{{b|}}}
 +
              | {{!}}border
 +
            }}{{#if: {{{link|}}}
 +
               | {{!}}link={{{link|}}}
 +
             }}<!--{{#if: {{{page|}}}
 +
                 | {{!}}link=page:{{{1|}}}
 +
             }}-->{{#if: {{{red|}}}
 +
                 | {{!}}link={{canonicalurl:{{urlencode:page:{{{1|}}}|wiki}}|action=edit&redlink=1}}
 +
             }}]]
 
     }}</td>
 
     }}</td>
 
   </tr>
 
   </tr>

Latest revision as of 02:47, 23 November 2023

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

This template allows the creation of a flexible gallery by drawing a floating box around each image. The first variable should be the image name, and the second the caption. If you need to link to a different page or an external link, just add an additional variable called {{{link}}}. Main headings (those created with ==) will bookend the floating gallery, but if you're using this template inside of a section and need to include text after it, make sure to include CSS to keep the subsequent section from being displaced (by default, just use a <br /> tag). This code:

{{image|Noscans.png|Blank pages}}
{{image|Noscans.png|Blank pages}}
{{image|Noscans.png|Blank pages|link=Main Page}}
{{image|Noscans.png|Blank pages}}
{{image|Noscans.png|Blank pages}}
<br style="clear:both;"/>

Creates this gallery:

Blank pages
Noscans.png
Blank pages
Noscans.png
Blank pages
Noscans.png
Blank pages
Noscans.png
Blank pages
Noscans.png

Placeholders

To insert a text placeholder into the gallery, include a parameter called {{{ph}}} and enter the text of the placeholder in the nest argument. The {{{ph}}} parameter can actually be placed anywhere in the template, but putting it first makes it easier to transform a gallery into an index page through find-and-replace.

{{image|Noscans.png|Blank pages}}
{{image|Noscans.png|Blank pages}}
{{image|ph=1|Placeholder|Placeholder}}
{{image|Noscans.png|Blank pages}}
{{image|Noscans.png|Blank pages}}
<br style="clear:both;"/>
Blank pages
Noscans.png
Blank pages
Noscans.png
Placeholder
Blank pages
Noscans.png
Blank pages
Noscans.png

Index links

To link images in a gallery directly to their transcription in the Page namespace (rather than the default File namespace), include a parameter called {{{page}}}. Again, best practice is to place it as the first argument.

{{image|page=1|Noscans.png|Blank pages}}
{{image|page=1|Noscans.png|Blank pages}}
{{image|page=1|Noscans.png|Blank pages}}
{{image|page=1|Noscans.png|Blank pages}}
{{image|page=1|Noscans.png|Blank pages}}
<br style="clear:both;"/>
Blank pages
Noscans.png
Blank pages
Noscans.png
Blank pages
Noscans.png
Blank pages
Noscans.png
Blank pages
Noscans.png