Difference between revisions of "Template:Icon"
(Iconize) |
m |
||
Line 15: | Line 15: | ||
<noinclude> | <noinclude> | ||
− | This template | + | This template use the #switch function of the [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions ParserFunctions extension]. |
+ | |||
+ | General syntax is : <div style="{{{Position}}}">[[Image:{{{1}}}.png|{{{3}}}px]]</div> | ||
+ | |||
+ | For parameter 2 (position) only values 1 & 3 actually works. | ||
+ | |||
+ | ;Valid expressions | ||
+ | :Left | ||
+ | :Right | ||
+ | ;Unvalid expressions | ||
+ | :Center | ||
+ | :Middle | ||
+ | :Top | ||
+ | :Bottom | ||
I see no reason for that I couldn't work. So you can : | I see no reason for that I couldn't work. So you can : | ||
Line 24: | Line 37: | ||
== Help == | == Help == | ||
− | This template | + | This template use three (numbered=default) parameters : |
;1. Module : Seven values available | ;1. Module : Seven values available | ||
Line 49: | Line 62: | ||
− | ; | + | ;Examples in table cells |
<br> | <br> | ||
− | {| border="1" style="width: 800px; height: 120px;" | + | {| border="1" style="width: 800px; height: 120px;" |
− | + | ||
|- | |- | ||
! 2nd Parameter: Position. Mapping: | ! 2nd Parameter: Position. Mapping: | ||
− | ! | + | ! The call should be : |
− | ! | + | ! No template called here : |
|- | |- | ||
| <center> | | <center> | ||
Line 86: | Line 98: | ||
| <center>'''Code :'''<br><nowiki>{{Icon|Calc|3|40}}</nowiki></center> | | <center>'''Code :'''<br><nowiki>{{Icon|Calc|3|40}}</nowiki></center> | ||
| <div style="float: right; align: top; margin-top: 2px;">[[Image:Calc.png|40px]]</div> | | <div style="float: right; align: top; margin-top: 2px;">[[Image:Calc.png|40px]]</div> | ||
− | The result is now a 40 pixels floating Calc icon, at the top right of the cell... | + | The result is now a 40 pixels floating Calc icon, at the top right of the cell... The result is now a 40 pixels floating Calc icon, at the top right... |
+ | |- | ||
+ | ! Colspan=3 | Real examples (Template calls) | ||
+ | |- | ||
+ | |{{Icon|Impress|1|120}} | ||
+ | Impress icon is called with <code><nowiki>{{Icon|Impress|1|120}}</nowiki></code> and this example need a lot of text to fill the cell, because of the icon size. Impress icon is called with <code><nowiki>{{Icon|Impress|1|120}}</nowiki></code> and this example need a lot of text to fill the cell, because of the icon size. | ||
+ | |{{Icon|Math|3|60}} | ||
+ | The icon for Math, 60 pixels top-centered. Call <code><nowiki>{{Icon|Math|2|60}</nowiki></code>. The icon for Math, 60 pixels top-centered. Call <code><nowiki>{{Icon|Math|2|60}}</nowiki></code>. | ||
+ | |{{Icon|Base|3|80}} | ||
+ | <code><nowiki>{{</nowiki>Icon|Base|3|80}}</code> Give a floating icon for Base, 80 pixel sized, top right aligned. <code><nowiki>{{</nowiki>Icon|Base|3|80}}</code> Give a floating icon for Base, 80 pixel sized, top right aligned. <code><nowiki>{{</nowiki>Icon|Base|3|80}}</code> Give a floating icon for Base, 80 pixel sized, top right aligned. | ||
+ | |- | ||
+ | |{{Icon|Edit|4|60}}Edit | ||
+ | |{{Icon|Draw|5|75}}Draw | ||
+ | |{{Icon|Writer|6|90}}Writer | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</noinclude> | </noinclude> |
Revision as of 19:24, 23 May 2009
This template use the #switch function of the ParserFunctions extension.
General syntax is :For parameter 2 (position) only values 1 & 3 actually works.
- Valid expressions
- Left
- Right
- Unvalid expressions
- Center
- Middle
- Top
- Bottom
I see no reason for that I couldn't work. So you can :
- Help me.
- Be patient.
- Explain briefly why I could never be valid. or make me discover another existing simple syntax for this possibility.
Help
This template use three (numbered=default) parameters :
- 1. Module
- Seven values available
- 2. Position
Nine values from 1 to 9
|
|
- 3. Size in pixels
- Optional, thus in third position. Max size if ignored.
- Examples in table cells
2nd Parameter: Position. Mapping: | The call should be : | No template called here : | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
{{Icon|Calc|3|40}} |
The result is now a 40 pixels floating Calc icon, at the top right of the cell... The result is now a 40 pixels floating Calc icon, at the top right... | |||||||||||
Real examples (Template calls) | |||||||||||||
Impress icon is called with |
The icon for Math, 60 pixels top-centered. Call |
| |||||||||||
|
|
|