Template:Navimg/doc

From MeritBadgeDotOrg

(Difference between revisions)
Jump to: navigation, search
(Creating "/doc" page for this template)
Current revision (22:34, May 5, 2019) (edit) (undo)
m (Scouts BSA)
 
Line 13: Line 13:
|height= <!-- (Required) E.g.: 44px -->
|height= <!-- (Required) E.g.: 44px -->
|image = <!-- (Required) E.g.: FleurDeLis.png -->
|image = <!-- (Required) E.g.: FleurDeLis.png -->
-
|link = <!-- (Required) E.g.: Boy Scouting (I.e., Name of internal link (without the [[brackets]]) -->
+
|link = <!-- (Required) E.g.: Scouts BSA Portal (i.e., Name of internal link (without the [[brackets]])) -->
}}</nowiki>
}}</nowiki>
Line 22: Line 22:
|height= 44px
|height= 44px
|image = FleurDeLis.png
|image = FleurDeLis.png
-
|link = Boy Scout Portal
+
|link = Scouts BSA Portal
}}</nowiki>
}}</nowiki>
Line 29: Line 29:
|height= 44px
|height= 44px
|image = FleurDeLis.png
|image = FleurDeLis.png
-
|link = Boy Scout Portal
+
|link = Scouts BSA Portal
-
}} ''Notice when you move your mouse (hover) over the BSA logo, the link is to [[Boy Scout Portal]] not [[:Image:FleurDeLis.png]].''
+
}} ''Notice when you move your mouse (hover) over the BSA logo, the link is to [[Scouts BSA Portal]] not [[:Image:FleurDeLis.png]].''
===75px x 75px===
===75px x 75px===
Line 37: Line 37:
|height= 75px
|height= 75px
|image = FleurDeLis.png
|image = FleurDeLis.png
-
|link = Boy Scout Portal
+
|link = Scouts BSA Portal
}}</nowiki>
}}</nowiki>
Line 44: Line 44:
|height= 75px
|height= 75px
|image = FleurDeLis.png
|image = FleurDeLis.png
-
|link = Boy Scout Portal
+
|link = Scouts BSA Portal
}}
}}

Current revision


Usage

The automatic link created by MediaWiki when you insert an image is to that image's page. But many, if not most, users want to go to the article — not to download the image, i.e., ending up somewhere they weren't expecting.

Navimg allows you to use an image as a link to an article. Click on the image and you go to the article, instead of the image.

Parameters

{{Navimg
 |width =         <!-- (Required) E.g.: 44px -->
 |height=         <!-- (Required) E.g.: 44px -->
 |image =         <!-- (Required) E.g.: FleurDeLis.png -->
 |link  =         <!-- (Required) E.g.: Scouts BSA Portal (i.e., Name of internal link (without the [[brackets]])) -->
 }}

Examples

Simple 44px x 44px

{{Navimg
 |width = 44px
 |height= 44px
 |image = FleurDeLis.png
 |link  = Scouts BSA Portal
 }}
image page
Notice when you move your mouse (hover) over the BSA logo, the link is to Scouts BSA Portal not Image:FleurDeLis.png.

75px x 75px

{{Navimg
 |width = 75px
 |height= 75px
 |image = FleurDeLis.png
 |link  = Scouts BSA Portal
 }}
image page

Left, right, or center alignment

Use div align to set the location to left, right or center.

<div align="center">{{Navimg 
 |width = 95px   
 |height= 100px 
 |image = Venturing GrY.png  
 |link = Venturing Portal
 }}</div> 

Single line example

{{Navimg|width = 52px|height= 52px|image = iphone.png|link  = M.Main_Page}}
image page

As a part of a message box

{| style="width: 80%; margin: 0 0 0 10%; border-collapse: collapse; background: #DDEEEE; border: 1px solid #aaa; border-left: 10px solid #1e90ff;"
 |- 
 | style="width: 52px; padding: 2px 0px 2px 0.5em; text-align: center;" | 
 {{Navimg|width = 52px|height= 52px|image = iphone.png|link  = M.Main_Page}}
 | style="padding: 0.25em 0.5em;" | <center>◄— Check out the new 
 <span class="plainlinks">[{{fullurl:m.Main Page|useskin=myskin}} Mobile interface]</span> link.  
 You can always have the requirements with you! Test it on your phone!</center>
 |}
◄— Check out the new Mobile interface link. You can always have the requirements with you! Test it on your phone!
Personal tools
language