Template:Navimg

From MeritBadgeDotOrg

(Difference between revisions)
Jump to: navigation, search
(Simple 50px x 50px: update link)
Current revision (13:55, August 3, 2012) (edit) (undo)
m (Protected "Template:Navimg": Highly susceptible to abuse/vandalism [edit=sysop:move=sysop])
 
(3 intermediate revisions not shown.)
Line 1: Line 1:
-
<div style="position: relative; width: {{{width|{{{size|}}}}}}; height: {{{height|{{{size|}}}}}}; overflow: hidden;"><div style="position: absolute; top: 0; left: 0; font-size: 200pt; width: {{{width|{{{size|}}}}}}; height: {{{height|{{{size|}}}}}}; overflow: hidden; line-height: {{{height|{{{size|}}}}}}; z-index: 3;">[[:{{{link|}}}|{{{linktext|&nbsp;}}}]]</div><div style="position: absolute; top: 0; left: 0; z-index: 2;">[[Image:{{{image|}}}|{{{width|{{{size|}}}}}}|image page]]</div></div><noinclude>
+
<div style="position: relative; width: {{{width|{{{size|}}}}}}; height: {{{height|{{{size|}}}}}}; overflow: hidden;"><div style="position: absolute; top: 0; left: 0; font-size: 200pt; width: {{{width|{{{size|}}}}}}; height: {{{height|{{{size|}}}}}}; overflow: hidden; line-height: {{{height|{{{size|}}}}}}; z-index: 3;">[[:{{{link|}}}|{{{linktext|&nbsp;}}}]]</div><div style="position: absolute; top: 0; left: 0; z-index: 2;">[[Image:{{{image|}}}|{{{width|{{{size|}}}}}}|image page]]</div></div><noinclude>{{Documentation}}
-
==Use==
+
<!-- ADD TEMPLATE TAGGING CATEGORIES and TEMPLATE DOCUMENTATION CATEGORIES TO THE "/doc" SUB-PAGE -->
-
The automatic link created by Wikipedia when you insert an image is to that image's page. But many if not most users want to go to the article, not download the image and end up in a dead end.
+
</noinclude>
-
 
+
-
Navimg allows you to use an image as a link to an article. Click the image and you go to that article not the image pages.
+
-
 
+
-
==Format==
+
-
<nowiki>{{Navimg
+
-
|width = <!-- required: such as "100px" -->
+
-
|height= <!-- required: such as "100px" -->
+
-
|image = <!-- required: such as: FleurDeLis.png -->
+
-
|link = <!-- required: such as: Boy Scouting - name of the WIki page without [[brackets]]] -->
+
-
}}</nowiki>
+
-
 
+
-
==Examples==
+
-
===Simple 50px x 50px===
+
-
<nowiki>{{Navimg
+
-
|width = 50px
+
-
|height= 50px
+
-
|image = FleurDeLis.png
+
-
|link = Boy Scout Portal
+
-
}}</nowiki>
+
-
 
+
-
{{Navimg
+
-
|width = 50px
+
-
|height= 50px
+
-
|image = FleurDeLis.png
+
-
|link = Boy Scouting
+
-
}} ''Notice when you move your mouse (hover) over the BSA logo, the link is to [[Boy Scout Portal]] not [[:Image:FleurDeLis.png]].''
+
-
 
+
-
===75px x 75px===
+
-
<nowiki>{{Navimg
+
-
|width = 75px
+
-
|height= 75px
+
-
|image = FleurDeLis.png
+
-
|link = Boy Scouting
+
-
}}</nowiki>
+
-
 
+
-
{{Navimg
+
-
|width = 75px
+
-
|height= 75px
+
-
|image = FleurDeLis.png
+
-
|link = Boy Scouting
+
-
}}
+
-
 
+
-
===Veritcal Alignment===
+
-
Use div align to set the location to left, right or center.
+
-
 
+
-
<nowiki><div align="center">{{Navimg
+
-
|width = 95px
+
-
|height= 100px
+
-
|image = Venturing GrY.png
+
-
|link = Venturing
+
-
}}</div></nowiki>
+
-
 
+
-
<div align="center">{{Navimg
+
-
|width = 95px
+
-
|height= 100px
+
-
|image = Venturing GrY.png
+
-
|link = Venturing
+
-
}}</div>
+
-
 
+
-
 
+
-
===Single line example===
+
-
<nowiki>{{Navimg|width = 52px|height= 52px|image = iphone.png|link = M.Main_Page}}</nowiki>
+
-
 
+
-
{{Navimg|width = 52px|height= 52px|image = iphone.png|link = M.Main_Page}}
+
-
 
+
-
 
+
-
===As a part of a message box===
+
-
<nowiki>{| 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/PDA interface]</span> link.
+
-
You can always have the requirements with you! Test it on your phone!</center>
+
-
|}</nowiki>
+
-
 
+
-
 
+
-
{| 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/PDA interface]</span> link. You can always have the requirements with you! Test it on your phone!</center>
+
-
|}
+

Current revision

[[:| ]]
[[Image:||image page]]
Personal tools
language