Difference between revisions of "Template:Hidden sort key"

From blackwiki
Jump to navigation Jump to search
imported>Primefac
m (Changed protection level for "Template:Hidden sort key": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
imported>TheDJ
(move the sortkey to a data attribute)
Line 1: Line 1:
<span class="sortkey">{{{1}}}</span><noinclude>
+
<span data-sort-value="{{#invoke:sortkey|encode|{{{1}}}}}" style="display:none;">&nbsp;<!-- Tidy removes empty spans. Keep this until remexHTML is deployed--></span><noinclude>
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 14:46, 23 June 2018

 

Template documentation[view] [edit] [history] [purge]

This template allows you to specify its parameter as the sort key for a cell in sortable tables.

Usage

{{Hidden sort key|sort term}} 
Insert this template with the appropriate sort term before the cell data.

Example

{| class="wikitable sortable"
|-
!C1
|-
|{{Hidden sort key|1999-12-15}}15 December 1999
|-
|{{Hidden sort key|1997-04-21}}21 April 1997
|-
|{{Hidden sort key|1998-04-21}}21 April 1998
|}
produces:
C1
 15 December 1999
 21 April 1997
 21 April 1998

See also

ja:Template:Hs no:Mal:Skjulsorter pt:Predefinição:Ord ur:سانچہ:Hs vi:Tiêu bản:Hs zh:Template:Hs