Template:CD

From Zelda Dungeon Wiki
Jump to: navigation, search


Purpose

The Contextual Display template presents information in various ways depending on context. It is used for converting listings into appropriate navigation displays.

Usage

Define the context before any CD items using {{CD/Decorator| type | id }}

  • type — The type of display to use for any subsequent CD items.

Valid display types are:

table (default)
lists items in table format including image, name, and description
gallery
groups headers as tabs and arranges items in gallery format, displaying their image and caption
hlist
for use in {{Navboxes}}; displays only item names grouped by header

For the gallery type, a unique id is required, such as "LttPEnemies".

Instead of using normal level two headers (==Header==), this template requires the use of {{CD/Header| text }}

  • text — The text of the header. If there is only one section and it doesn't require a header, leave this parameter blank but leave the pipe. (i.e. {{CD/Header| }})

For each item, use {{CD| file= | link= | tip= | caption= | desc= }}

  • file — The name of the image file (without the File: prefix). (Optional. Default: No Image.png)
  • link — The link for both the image and the caption.
  • tip — A tooltip that displays when hovering over the image. (Optional. Default: same as caption (or link))
  • caption — The text of the caption, if different from the link. (Optional. Default: same as link)
  • desc — A brief description of the item, which is only displayed in table mode. (Optional.)

Finally, place {{CD/End| }} at the end of each section. (Note the pipe.) If using the gallery display mode, it's also necessary to place </div> at the very end of the whole list.

Example

{{CD/Decorator|gallery|gal1}}
{{CD/Header|Section 1}}
{{CD|file=|link=Template:CD/Decorator|caption=CD Decorator}}
{{CD|file=|link=Template:CD/Header|caption=CD Header}}
{{CD/End|}}
{{CD/Header|Section 2}}
{{CD|file=|link=Template:CD|caption=CD}}
{{CD/End|}}
</div>