Template:Hint: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
Line 1: Line 1:
<includeonly><templatestyles src="Template:Hint/styles.css" /><span class="wiki-hint {{#if:{{{3|}}}|wiki-hint-no-border}}">{{{1}}}<span class="wiki-hint-floating">{{{2}}}</span></span></includeonly><noinclude>
<includeonly><!--
--><templatestyles src="Template:Hint/styles.css" /><!--
--><span class="wiki-hint <!--
            -->wiki-hint-{{{side|top}}} <!--
            -->{{#iferror: {{#ifexpr: {{#pos: {{{1|}}} | File }} >= 0 | wiki-hint-no-border }}|}} <!--
            -->"<!--
-->><!--
    -->{{{1}}}<span class="wiki-hint-floating">{{{2}}}</span><!--
--></span><!--
################################################################################
--></includeonly><noinclude>


A minor tooltip for short descriptions. As opposed to the "title" attribute, it has the following advantages:
A minor tooltip for short descriptions. As opposed to the "title" attribute, it has the following advantages:
* It's instant upon hover (has no delay)
* It's instant upon hover (has no delay)
* It uses a skin customized for Olden Era
* It uses a skin customized for Olden Era
* Wraps the text if too long
* Can be placed top/left/right/bottom. Defaults to "top".


== Usage ==
== Usage ==
1. For texts:
1. Basic:
<pre><nowiki>{{hint | Hello | World}}</nowiki></pre>
 
Result: {{hint | Hello | World}}
{{Color|yellow|Input:}} <code><nowiki>{{Hint | Hello | World}}</nowiki></code>
 
{{Color|lime|Output:}} {{Hint | Hello | World}}
 
----
2. With images. In such cases, the subtle underline is automatically removed.
 
{{Color|yellow|Input:}} <code><nowiki>{{Hint | [[File:Icon_Resource_Wood.png]] | Wood}}</nowiki></code>
 
{{Color|lime|Output:}} {{Hint | [[File:Icon_Resource_Wood.png]] | Wood}}
 
----
3. With a lot of text
 
{{Color|yellow|Input:}} <code><nowiki>{{Hint | Lorem | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}}</nowiki></code>
 
{{Color|lime|Output:}} {{Hint | Lorem | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}}
 
----
4. Placed at the "bottom":
 
{{Color|yellow|Input:}} <code><nowiki>{{Hint | Hello | World | side=bottom}}</nowiki></code>
 
{{Color|lime|Output:}} {{Hint | Hello | World | side=bottom}}
 
----
----
2. For icons, pass a third parameter to disable the subtle border:
5. Placed to the "left":
<pre><nowiki>{{hint | [[File:Icon_Resource_Wood.png]] | Wood | 0}}</nowiki></pre>
 
Result: {{hint | [[File:Icon_Resource_Wood.png]] | Wood | 0}}
{{Color|yellow|Input:}} <code><nowiki>{{Hint | Hello | World | side=left}}</nowiki></code>
 
{{Color|lime|Output:}} {{Hint | Hello | World | side=left}}
 
----
6. Placed to the "right":
 
{{Color|yellow|Input:}} <code><nowiki>{{Hint | Hello | World | side=right}}</nowiki></code>


{{Color|lime|Output:}} {{Hint | Hello | World | side=right}}


[[Category:Formatting templates]]</noinclude>
</noinclude>

Revision as of 11:21, 23 June 2026


A minor tooltip for short descriptions. As opposed to the "title" attribute, it has the following advantages:

  • It's instant upon hover (has no delay)
  • It uses a skin customized for Olden Era
  • Wraps the text if too long
  • Can be placed top/left/right/bottom. Defaults to "top".

Usage

1. Basic:

Input: {{Hint | Hello | World}}

Output: Hello World


2. With images. In such cases, the subtle underline is automatically removed.

Input: {{Hint | [[File:Icon_Resource_Wood.png]] | Wood}}

Output: Wood


3. With a lot of text

Input: {{Hint | Lorem | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}}

Output: Lorem Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.


4. Placed at the "bottom":

Input: {{Hint | Hello | World | side=bottom}}

Output: Hello World


5. Placed to the "left":

Input: {{Hint | Hello | World | side=left}}

Output: Hello World


6. Placed to the "right":

Input: {{Hint | Hello | World | side=right}}

Output: Hello World