Template:Tooltip/doc

From Lotro-Wiki.com
Jump to navigation Jump to search
This is the template documentation for {{Tooltip}}. It is transcluded from Template:Tooltip/doc and may be directly edited there.

This template provides most of the basic capabilities for Lotro-Wiki's tooltip ("pop-up") displays. It is not intended to be used directly, but rather constitutes a "back-end" for higher-level templates such as Template:Item Tooltip and Template:Effect. As more of our templates become modernized, we'll be able to provide the pop-up functionality for additional pages, such as quests, skills, and the like.

  • Tooltip enabled pages are currently on all pages using

Modes

There are currently five modes available for tooltip-enabled pages.

mode=link
This displays simply as a pop-up enabled link. Hovering the mouse over the link will display any tooltip content on the target page.
Example: {{:Hope (Effect)|mode=link}} yields Hope
Note: This is unnecessary for pages in the Item: namespace, as links to items are auto-enabled for pop-ups.
mode=icon
This mode displays the icon defined at the target page, with an optional amount overlay.
Example: {{:Item:Minstrel's Friend|mode=icon|amount=3}} yields 3
Example: {{:Hope (Effect)|mode=icon|amount=3}} yields
Note: amount will only work for pages that properly pass amount parameters down to this template (i.e. only items at this point). Also, because icons created this way act as a link to the target page, icons will generate a on-hover pop-up.
mode=imlink
This is a combination of the previous two modes and displays the familiar icon-and-link format widely used for item and effect links on Lotro-Wiki. For item pages with a defined quality, the link will be displayed in that item's quality. Included in or mimicked by Template:Reward and Template:Barter
Example 1: {{:Hope (Effect)|mode=imlink}} yields  Hope
Example 2a: {{:Item:Token of Valour|mode=imlink|amount=3}} yields 3  Token of Valour
Example 2b: {{:Item:Token of Valour|mode=imlink_plain}} yields  Token of Valour
Note: Items can be displayed without quality colouring (as in example 2b) by using the pseudo-mode imlink_plain defined in Template:Item Tooltip. This is the default functioning for Template:Reward as use of colours is generally discouraged outside of specific template cases. Display of amount overlays is bugged when using this method, though, so either a) use colours and overlay together or b, preferred) don't use overlays at all.
mode=tableimlink
This is the same as the previous mode, but places the icon and the link in separate elements in a new table row. This may be useful in cases where long item names cause unpleasant wrapping in narrow table cells.
Example:
{|
!Column A!!Column B
|-
{{:Item:Fruit Roll|mode=tableimlink}}
|-
{{:Item:Lover's Helm|mode=tableimlink}}
|}
Column A Column B
  Fruit Roll
  Lover's Helm
mode=reliclink
This mode is used exclusively inside the {{Item Tooltip}} template to transclude relics directly into item tooltips.
mode=disabled
This mode is ment to use on pages that have several tooltip-enabled templates, however it is desired that only one of them is shown.
On these pages the main template that will be used as tooltip will use the | mode={{{mode|}}} and all others will have | mode=disabled
Example:  Upshot

Using in Default Mode

The four modes listed above should only be used when directly calling (transcluding) an item or effect that is tooltip-enabled. Calling this template directly with any of these modes serves no purpose, as Template:Tooltip has no icon, stats, attributes, flavour text, etc. to display. All that information must be properly passed down by the item/effect page and the ensuing template chain. The syntax below constitutes the first step in that chain, and provides options for other templates to format the black tooltip box. Note the emphasis on "template," as this only creates a container for other templates to fill with information and is not intended to be used directly.

Syntax

{{Tooltip
| mode           = <!-- Sets the mode in which to display passed information,
                        use {{{mode|}}} when calling in an intermediate template -->
| icon           = <!-- The filename (omit ".png") of the icon to be displayed at the top left
                        Icons display at 32px when name matches disambigpage, 24px otherwise
| size           = <!-- Icon size, only used for mode=imlink.
                        For valid values, see [[Template:Icon]]. -->
| name           = <!-- The name of the item/effect/etc, displayed at
                        the top of the box just to the right of the icon -->
| disambigpage   = <!-- The name on which the last page in the chain will live,
                        this should generally be set to {{{disambigpage|}}} -->
| amount         = <!-- Used for stack overlay displays, this should generally
                        be set to {{{amount|}}} when dealing with items and omitted otherwise -->
| float          = <!-- Style the box to float left or right, default is
                        right when name matches disambigpage and left otherwise -->
| width          = <!-- Style the width of the box, default is 18em -->
| padtop         = <!-- Add additional padding between the top of the box
                        and the first line, defaults to 1em -->
| pad            = <!-- Add additional padding between the left edge of the box
                        and the enclosed text, default is 1em --.
| font-size      = <!-- Font size for the displayed name -->
| pre-text       = <!-- Optional text, only used for mode=imlink. The text is displayed as-is
                        before the "icon" and "name".
| mid-text       = <!-- Optional text, only used for mode=imlink. The text is displayed as-is
                        after the "icon" and before the "name".
| trailing-text  = <!-- Optional text, only used for mode=imlink. The text is displayed as-is
                        directly after "icon" and "name"; one white-space is padded before
                        this trailing-text. -->
| noclear        = <!-- ??? possibly has no effect -->
| smallicon      = <!-- The embedded relic icon displayed only with mode=reliclink -->
| attrib         = <!-- The attributes of the relic displayed only with mode=reliclink -->
| alltherest     = <!-- The remainder of the information included by next
                        template in the chain, formatted as needed -->
}}