Template:Dndbeyond tooltip: Difference between revisions

From Campaigns
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 7: Line 7:
--></div><!--
--></div><!--
--><div class="body">{{{text}}}</div><!--
--><div class="body">{{{text}}}</div><!--
--></div></span></span></onlyinclude>
--></div></span></span></onlyinclude><!--
{{documentation}}
-->{{documentation}}

Revision as of 05:52, 24 November 2021

{{{linktext}}}
{{{title}}}{{{type}}}
{{{text}}}
Template documentation

Creates the content for a tooltip popup similar to the one used by D&D Beyond. This template should not generally be used directly from an article, instead a template for a specific tooltip should be created, and that should be used from an article.

The content of the tooltip can be very finicky, and breaks out of its layout easily, ruining the tooltip effect. Make sure you test any new tooltip before calling it complete! If paragraphs are breaking out of the tooltip, you can use <span class="fake-p">...</span> to try and fix it. If lists are breaking out of the tooltip, you can use <span class="fake-ul"><span class="fake-li">...</span></span> to try and fix it.

A quick way to setup a new template using this tooltip template is to subst a preexisting template into the new file, same, and then edit with the correct data. For example, {{subst:warlock}} will get the code from {{warlock}} and copy it into your new template (well, all the code which would normally be transcluded when using the warlock template, which in this case is everything except the category).

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
link textlinktext

Text the user must hover over to view the tooltip. This can be wiki markup, but should be kept to inline output for best user experience.

Stringrequired
tooltip titletitle

Text displayed at the top of the tooltip window.

Stringrequired
tooltip typetype

Tag on the right side of the tooltip header.

Example
race, feat, class, etc.
Stringrequired
tooltip bodytext

Rich text body of the tooltip. Formatting likes to break, so test to make sure it works.

Stringrequired
icon representing the tooltipicon

A wiki markup image to be displayed on the left side of the title. Image will be scaled to 45x45.

Default
(omitted)
Example
[[File:aarakocra.jpg]]
Stringoptional
horizontal offsetoffsetx

Offset the tooltip from its default position by the given number of pixels.

Default
0
Numberoptional
vertical offsetoffsety

Offset the tooltip from its default position by the given number of pixels.

Default
0
Numberoptional