Template:Hov

From WMAwiki
Jump to: navigation, search

[[ {{{1}}} | {{{1}}} ]]

Background

Template:Hov is a mechanism for creating "brief definitions" of terms that also have full articles associated with them. For example, stringere redirects to to constrain, but it may be inconvenient to actually view the article on constraining to determine that. Therefore, it is desirable to provide a brief definition of the term when the reader mouses-over the link.

The wiki provides for mouse-overs on text, using Template:Hover. However, it is not directly possible to change the mouse-over text for links, which is the goal here. For this purpose, Template:Hoverlink was devised. This requires that the author specify the hovertext (i.e., the brief definition) every time the term is linked, which is undesirable, especially in case an author wishes to change the brief definition. Therefore, the definition is encapsulated in a separate article, which takes the same name as the article to briefly define, prefixed with

Template:Hover

Example

In the example given above, there is a page called Template:Hover:stringere containing the text

to constrain

Now,

{{hov|stringere}}

produces

 stringere 

(hold the mouse cursor over the link to see the text).

Usage

A link that would otherwise be entered as

[[foo]]

should instead be entered as

{{hov|foo}}

and a page entitled Template:Hover:foo be created containing a brief description of the term foo. It is essential to note that the capitalization must be the same in the Template:Hover page as in the link: Template:Hover:Foo will not be found.

Default

If no hover template page exists for a given link, the name of the link instead will be used, as in the following example:

{{hov|not an article that exists on this site}}

produces

 not an article that exists on this site