Difference between revisions of "Template:ImageText"

From Beasts of Bermuda
Jump to: navigation, search
m (removed indents)
m (removed not working trim template)
Line 7: Line 7:
 
style="display: flex; justify-content: center; align-items: center;  
 
style="display: flex; justify-content: center; align-items: center;  
 
width: {{{w|100}}}px; height: {{{h|100}}}px;">
 
width: {{{w|100}}}px; height: {{{h|100}}}px;">
[[File:
+
[[File:{{{1}}}|{{{w|100}}}x{{{h|100}}}px|{{{2}}}|link={{{link|}}}]]
{{trim|
 
{{{1}}}
 
}}
 
|{{{w|100}}}x{{{h|100}}}px
 
|{{trim|
 
{{{2}}}
 
}}
 
|link={{{link|}}}
 
]]
 
 
</div>
 
</div>
 
<div  
 
<div  
Line 22: Line 13:
 
style="width: {{{w|100}}}px; text-align: center;
 
style="width: {{{w|100}}}px; text-align: center;
 
{{#if: {{{font size|}}} | font-size: {{{font size}}}; }}">
 
{{#if: {{{font size|}}} | font-size: {{{font size}}}; }}">
{{#if:  
+
{{#if: {{{link|}}} | [[{{{link}}}|{{{2}}}]] | {{{2}}} }}
{{{link|}}}  
 
| [[{{{link}}}|{{trim|{{{2}}}}}]]  
 
| {{trim|{{{2}}}}}
 
}}
 
 
</div>
 
</div>
 
</div>
 
</div>

Revision as of 19:52, 24 November 2024


This template allows you to add images on top of a piece of text.

The element will be an inline block, meaning several can appear in one line. You can give them all a specific width and height to get a nice consistent layout.


Standard width/height is 100:

{{ ImageText | file:Nesting_MAINPAGE.png | Nesting }}
{{ ImageText | Enhanced Growth.png | Enhanced Growth }}
{{ ImageText | The Elements.png | Just a test with very very long text }}

Result:


Nesting

Nesting



Enhanced Growth

Enhanced Growth



Just a test with very very long text

Just a test with very very long text




Limiting width only; note this may cause the text to overflow as seen here:

{{ImageText | Nesting_MAINPAGE.png | Nesting | w = 50 }}
{{ImageText | Enhanced Growth.png | Enhanced Growth | w = 50 }}

Result:


Nesting

Nesting



Enhanced Growth

Enhanced Growth




Limiting height only:

{{ImageText | Nesting_MAINPAGE.png | Nesting | h = 50 }}
{{ImageText | Enhanced Growth.png | Enhanced Growth | h = 50 }}

Result:


Nesting

Nesting



Enhanced Growth

Enhanced Growth




Limiting width and height:

{{ImageText | Nesting_MAINPAGE.png | Nesting | w = 50 | h = 50 }}
{{ImageText | Enhanced Growth.png | Enhanced Growth | w = 50 | h = 50 }}

Result:


Nesting

Nesting



Enhanced Growth

Enhanced Growth




You might have noticed the text is often too wide for the icon... You can specify a font size:

{{ImageText | Nesting_MAINPAGE.png | Nesting | w = 80 | h = 80 | font size = 80% }}
{{ImageText | Enhanced Growth.png | Enhanced Growth | w = 80 | h = 80 | font size = 80% }}

Result:


Nesting

Nesting



Enhanced Growth

Enhanced Growth