Difference between revisions of "Template:Floatable index"

From GodWiki
Jump to navigation Jump to search
(Created template based on “Djonni’s floatable index”.)
Tags: mobile edit mobile web edit
 
(Fix width, enable parameters, documentation, categories)
Tags: mobile edit mobile web edit
Line 1: Line 1:
<div id="PageNav" class="noprint" style="position: fixed; top: 0; right: 0; z-index: 9999; padding: 0; margin: 0;">
+
<includeonly><div id="PageNav" class="noprint" style="position: fixed; top: 0; right: 0; z-index: 9999; padding: 0; margin: 0;"></includeonly>
 
{| class="wikitable" style="font-weight: bold; text-align: center; table-layout: fixed;"
 
{| class="wikitable" style="font-weight: bold; text-align: center; table-layout: fixed;"
|style="padding: 1px;"|[[#A|A]]
+
{{#if:{{yesno|{{{full|}}}}}|
|style="padding: 1px;"|[[#B|B]]
+
{{!}}style{{=}}"padding: 1px; width: 1.2em"{{!}}[[#0|0]]
 +
{{!}}style{{=}}"padding: 1px; width: 1.2em"{{!}}[[#1|1]]
 +
{{!}}-
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#2|2]]
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#3|3]]
 +
{{!}}-
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#4|4]]
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#5|5]]
 +
{{!}}-
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#6|6]]
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#7|7]]
 +
{{!}}-
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#8|8]]
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#9|9]]
 +
{{!}}-
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#A|A]]
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#B|B]]
 +
|
 +
{{!}}style{{=}}"padding: 1px; width: 1.2em"{{!}}[[#A|A]]
 +
{{!}}style{{=}}"padding: 1px; width: 1.2em"{{!}}[[#B|B]]
 +
}}
 
|-
 
|-
 
|style="padding: 1px;"|[[#C|C]]
 
|style="padding: 1px;"|[[#C|C]]
Line 39: Line 59:
 
|style="padding: 1px;"|[[#Y|Y]]
 
|style="padding: 1px;"|[[#Y|Y]]
 
|style="padding: 1px;"|[[#Z|Z]]
 
|style="padding: 1px;"|[[#Z|Z]]
|}
+
{{#if:{{yesno|{{{full|}}}}}|
</div>
+
{{!}}-
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#{{{special|Special}}|!]]
 +
{{!}}style{{=}}"padding: 1px;"{{!}}[[#{{{top|top}}}|↑]]}}
 +
|}<includeonly></div></includeonly><noinclude>
 +
{{Doc}}[[Category:Templates]][[Category:Formatting templates]]
 +
</noinclude>

Revision as of 06:45, 3 December 2019

A B
C D
E F
G H
I J
K L
M N
O P
Q R
S T
U V
W X
Y Z
[view] [edit] [history] [refresh]
📚 Documentation

The {{Floatable index}} template creates a floating alphabetic or alphanumeric index down the right-hand side of the page, designed to assist with navigation on large list pages.

Parameters

|full=yes
Set this to any yes-like value to include numbers, special characters, and top. The example on the right-hand side on this page has |full=y. The example above does not.
|special=
The anchor or heading to which the ! link should point. Default is Special.
|top=
The anchor or heading to which the link should point. Default is top.

Required page layout

For this template to be useful, the following must be true:

  • The page it is used on must have headings (or anchors) that are the capital letters of the English alphabet. If those headings are not present, tapping the letters will do nothing.
  • For the full index, there must also be headings (or anchors) for the 10 numerals, and also one for special, non-alphanumeric characters.
  • This index obscures the right-hand edge of the page on mobile devices. All tables should have the table property style="width: 95%;" or a suitable margin-right (about 2.5em). If you don't know how to do this, ask for help.
  • Because this index obscures the right-hand edge, it can make mobile editing of the page very difficult. The template should be placed at the top of the page, or away from the sections most likely to be edited, to minimise the chance it will appear on the user's screen while they are trying to edit your list.