Template:Tooltip/testcases
This is the template test cases page for the sandbox of Template:Tooltip. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins and parsers with these links: |
Testing Template:Tooltip
[edit]These are tests of using Template:Sronly inside Template:Tooltip, for accessibility improvements.
With no link, inside or outside the template
[edit]The most basic use case.
Code:
{{tooltip/sandbox|conflict of interest|in the specific sense employed in Wikipedia policy}}
Sandbox template output:
conflict of interestTooltip in the specific sense employed in Wikipedia policy
Current template output (lacks sronly):
conflict of interest
Using an outside-the-template link
[edit]Linking around the template was what we've been recommending for years, due to the old Chrome bug.
Code:
[[WP:COI|{{tooltip/sandbox|conflict of interest|in the specific sense employed in Wikipedia policy}}]]
Sandbox template output:
conflict of interestTooltip in the specific sense employed in Wikipedia policy
Current template output (lacks sronly):
Passing the link as the first parameter
[edit]This will also do the link internally to the template; boo-hoo for people using Chrome from many years ago. They have bigger problems than this, like massive security holes.
Code:
{{tooltip/sandbox|WP:COI|conflict of interest|in the specific sense employed in Wikipedia policy}}
Sandbox template output:
WP:COITooltip in the specific sense employed in Wikipedia policy
Current template output (outright broken for this use case, as it only accepts two parameters, not three):
WP:COI
Using the "link" parameter
[edit]This is a shorthand way to link the term, if the resulting target will be a real page (and the intended one). It had the same old Chrome-bug issue, but no one seemed to care, and it doesn't matter today anyway.
Code:
{{tooltip/sandbox|link=yes|WP:Conflict of interest|in the specific sense employed in Wikipedia policy}}
Sandbox template output:
WP:Conflict of interestTooltip in the specific sense employed in Wikipedia policy
Current template output (lacks sronly):
Manually linking the term inside the template
[edit]This was not advised because of a Chrome bug, but it is long since fixed. However, there is a still a problem: the link automatically has a title
supplied by MediaWiki (the page name), and this in most browsers will override the tooltip title
of the surrounding span. So, the intended tooltip will actually only be available to:
- screen readers
- in any graphical browser case in which a link is included but is not the entire term content, in which case the intended tooltip will be available when focus is over the span but is not over the part that is a link.
- in a graphical browser that doesn't treat link
title
s as tooltip but only as something to show in some other interface element such as the window footer (and here it will not matter if the entire term content is a link or not).
For this reason, the template instructions to prefer wrapping the template in the link should be retained, along with addition of the new three-parameter version ({{tooltip|linkTarget|termText|tooltipText}}
).
Code:
{{tooltip/sandbox|[[WP:COI|conflict of interest]]|in the specific sense employed in Wikipedia policy}}
Sandbox template output:
conflict of interestTooltip in the specific sense employed in Wikipedia policy
Current template output (lacks sronly):
Using the dotted=no parameter
[edit]Code:
{{tooltip/sandbox|conflict of interest|in the specific sense employed in Wikipedia policy|dotted=no}}
Sandbox template output:
conflict of interestTooltip in the specific sense employed in Wikipedia policy
Current template output (lacks sronly):
conflict of interest
Hebrew text
[edit]Code:
{{tooltip/sandbox|תוכן נִסתָר|תוכן ברור|dotted=no}}
Sandbox template output:
תוכן נִסתָרTooltip תוכן ברור
Current template output (lacks sronly):
תוכן נִסתָר
Double quotes in title text
[edit]Code:
{{tooltip/sandbox|conflict of interest|often abbreviated "coi"}}
Sandbox template output:
conflict of interestTooltip often abbreviated "coi"
Current template output (lacks sronly):
conflict of interest