Difference between revisions of "Template:With-desc"

From Archiveteam
Jump to navigation Jump to search
(You can make a word have a description tooltip. Useful if you want to write a description but have little space.)
 
Line 6: Line 6:
  <nowiki>{{with-desc|Yahoo!|It sucks.}}</nowiki>
  <nowiki>{{with-desc|Yahoo!|It sucks.}}</nowiki>


Hover your mouse above: {{with-desc|Yahoo!|It sucks.}}
Hover your mouse above: <span title='It sucks.' style='border-bottom: 1px dotted'>Yahoo!</span>


Most useful if you want an item have a description in a table with many columns. Saves space.
Most useful if you want an item have a description in a table with many columns. Saves space.
Line 12: Line 12:
You can use it also in wikilinks, in this case let it be the second parameter of the wikilink (the shown text):
You can use it also in wikilinks, in this case let it be the second parameter of the wikilink (the shown text):


  <nowiki>[[Yahoo!|{{with-desc|Yahoo!|It sucks.}}]]</nowiki>
  <nowiki>[[Yahoo!|{{with-desc|Yahoo!|<span title='It sucks.' style='border-bottom: 1px dotted'>Yahoo!</span>}}]]</nowiki>


Result: [[Yahoo!|{{with-desc|Yahoo!|It sucks.}}]]
Result: [[Yahoo!|{{with-desc|Yahoo!|It sucks.}}]]


'''Do not''' use single quotes in any of the parameters (breaks the code). Use double quotes instead.


The dotted underline is not because its beautiful, but to indicate that it's worth to hover above the text (it has a description).
The dotted underline is not because its beautiful, but to indicate that it's worth to hover above the text (it has a description).
</noinclude>
</noinclude>
<includeonly>
<includeonly>
<span title="{{{2}}}" style="border-bottom: 1px dotted">{{{1}}}</span>
<span title='{{{2}}}' style='border-bottom: 1px dotted'>{{{1}}}</span>
</includeonly>
</includeonly>

Revision as of 18:31, 7 June 2015

This template prints its first parameter with a tooltip set in its second parameter.

Example:

{{with-desc|Yahoo!|It sucks.}}

Hover your mouse above: Yahoo!

Most useful if you want an item have a description in a table with many columns. Saves space.

You can use it also in wikilinks, in this case let it be the second parameter of the wikilink (the shown text):

[[Yahoo!|{{with-desc|Yahoo!|<span title='It sucks.' style='border-bottom: 1px dotted'>Yahoo!</span>}}]]

Result: Yahoo!


Do not use single quotes in any of the parameters (breaks the code). Use double quotes instead.

The dotted underline is not because its beautiful, but to indicate that it's worth to hover above the text (it has a description).