Difference between revisions of "Template:Icon"
m (Add Book Icon + Wiki remap) |
(Try to enhance) |
||
Line 1: | Line 1: | ||
− | + | <!--> A simple concat string case dependant <--> | |
− | {{ #switch:{{{2}}} | + | <div style= {{ #switch:{{{2}}} |
− | | 1 = "float: left; align: top; | + | | 1 = "clear:left; float: left; align: top; |
− | | 2 = "float: center; align: top; | + | | 2 = "clear:center; float: center; align: top; |
− | | 3 = "float: right; align: top; | + | | 3 = "clear:right; float: right; align: top; |
− | | 4 = "float: left; align: center; | + | | 4 = "clear:left; float: left; align: center; |
− | | 5 = "float: center; align: center; | + | | 5 = "clear:center; float: center; align: center; |
− | | 6 = "float: | + | | 6 = "clear:right; float: right; align: center; |
− | | 7 = "float: left; align: bottom; | + | | 7 = "clear:left; float: left; align: bottom; |
− | | 8 = "float: center; align: bottom; | + | | 8 = "clear:center; float: center; align: bottom; |
− | | 9 = "float: | + | | 9 = "clear:right; float: right; align: bottom; |
}} | }} | ||
− | ">[[Image:{{ #switch:{{{1}}} | + | ">[[Image: {{ #switch:{{{1}}} |
| Base = Base | | Base = Base | ||
| Calc = Calc | | Calc = Calc | ||
Line 18: | Line 18: | ||
| Math = Math | | Math = Math | ||
| Writer = Writer | | Writer = Writer | ||
− | | Book = | + | | Book <!--> You can add many words pointing to the same. Keep reference (line with "=") at the end <--> |
+ | | Livre | ||
| Wiki = Book | | Wiki = Book | ||
| Edit <!--> The default value. Keep it at the end of the list ! <--> | | Edit <!--> The default value. Keep it at the end of the list ! <--> |
Revision as of 13:01, 25 May 2009
This template use the #switch function of the 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 :
- 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
- Displayed below. To permit another icon it need to be registered in this template.
- 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 : | An example of call with Calc : | 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... | |||||||||||
Nine real examples ordered by position (Template calls) | |||||||||||||
Impress icon is called with |
The icon for Math, 60 pixels top-centered. Call |
| |||||||||||
|
|
| |||||||||||
|
|
|