Hilfe:Sortieren
In vielen Situationen werden Listen von Seitentiteln oder Benutzernamen von MediaWiki alphabetisch sortiert. Es ist auch möglich, JavaScript zu verwenden, um Listen von Daten zu sortieren, die im Seitentext enthalten sind.
Sortierreihenfolge
Wenn Listen von MediaWiki alphabetically sortiert werden, wird die Reihenfolge der Zeichen mit Intl.Collator
sortiert.
Dadurch werden akzentuierte Zeichen auf der Grundlage von PageContentLanguage
korrekt sortiert.
Android-Webviews unterstützen dies nicht, so dass ein Fallback auf die alte Sortierroutine erforderlich ist. Die Reihenfolge ist dieselbe wie die der Unicode Codepunkte. Einige der häufigsten Zeichen sind wie folgt geordnet (in aufsteigender Reihenfolge):
! | " | # | $ | % | & | ' | ( | ) | * | + | , | - | . | / | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | : | ; | < | = | > | ? | @ | 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 | [ | \ | ] | ^ | _ | ` | 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 | { | | | } | ~ | ¡ | ¢ | £ | ¤ | ¥ | ¦ | § | ¨ | © | ª | « | ¬ | |
|
® | ¯ | ° | ± | ² | ³ | ´ | µ | ¶ | · | ¸ | ¹ | º | » | ¼ | ½ | ¾ | ¿ | À | Á | Â | Ã | Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í | Î | Ï | Ð |
Ñ | Ò | Ó | Ô | Õ | Ö | × | Ø | Ù | Ú | Û | Ü | Ý | Þ | ß | à | á | â | ã | ä | å | æ | ç | è | é | ê | ë | ì | í | î | ï | ð | ñ | ò | ó | ô |
õ | ö | ÷ | ø | ù | ú | û | ü | ý | þ | ÿ | Ā | ā | Ă | ă | Ą | ą | Ć | ć | Ĉ | ĉ | Ċ | ċ | Č | č | Ď | ď | Đ | đ | Ē | ē | Ĕ | ĕ | Ė | ė | Ę |
ę | Ě | ě | Ĝ | ĝ | Ğ | ğ | Ġ | ġ | Ģ | ģ | Ĥ | ĥ | Ħ | ħ | Ĩ | ĩ | Ī | ī | Ĭ | ĭ | Į | į | İ | ı | IJ | ij | Ĵ | ĵ | Ķ | ķ | ĸ | Ĺ | ĺ | Ļ | ļ |
Ľ | ľ | Ŀ | ŀ | Ł | ł | Ń | ń | Ņ | ņ | Ň | ň | ʼn | Ŋ | ŋ | Ō | ō | Ŏ | ŏ | Ő | ő | Œ | œ | Ŕ | ŕ | Ŗ | ŗ | Ř | ř | Ś | ś | Ŝ | ŝ | Ş | ş | Š |
š | Ţ | ţ | Ť | ť | Ŧ | ŧ | Ũ | ũ | Ū | ū | Ŭ | ŭ | Ů | ů | Ű | ű | Ų | ų | Ŵ | ŵ | Ŷ | ŷ | Ÿ | Ź | ź | Ż | ż | Ž | ž | ſ | Ə | ƒ | Ǻ | ǻ | Ǽ |
ǽ | Ǿ | ǿ | Ș | ș | Ț | ț | ə | ˆ | ˇ | ˉ | ˘ | ˙ | ˚ | ˛ | ˜ | ˝ | ΄ | ΅ | Ά | · | Έ | Ή | Ί | Ό | Ύ | Ώ | ΐ | Α | Β | Γ | Δ | Ε | Ζ | Η | Θ |
Ι | Κ | Λ | Μ | Ν | Ξ | Ο | Π | Ρ | Σ | Τ | Υ | Φ | Χ | Ψ | Ω | Ϊ | Ϋ | ά | έ | ή | ί | ΰ | α | β | γ | δ | ε | ζ | η | θ | ι | κ | λ | μ | ν |
ξ | ο | π | ρ | ς | σ | τ | υ | φ | χ | ψ | ω | ϊ | ϋ | ό | ύ | ώ | Ѐ | Ё | Ђ | Ѓ | Є | Ѕ | І | Ї | Ј | Љ | Њ | Ћ | Ќ | Ѝ | Ў | Џ | А | Б | В |
Г | Д | Е | Ж | З | И | Й | К | Л | М | Н | О | П | Р | С | Т | У | Ф | Х | Ц | Ч | Ш | Щ | Ъ | Ы | Ь | Э | Ю | Я | а | б | в | г | д | е | ж |
з | и | й | к | л | м | н | о | п | р | с | т | у | ф | х | ц | ч | ш | щ | ъ | ы | ь | э | ю | я | ѐ | ё | ђ | ѓ | є | ѕ | і | ї | ј | љ | њ |
ћ | ќ | ѝ | ў | џ | Ґ | ґ | Ḃ | ḃ | Ḋ | ḋ | Ḟ | ḟ | Ṁ | ṁ | Ṗ | ṗ | Ṡ | ṡ | Ṫ | ṫ | Ẁ | ẁ | Ẃ | ẃ | Ẅ | ẅ | Ỳ | ỳ | – | — | ― | ‗ | ‘ | ’ | ‚ |
‛ | “ | ” | „ | † | ‡ | • | … | ‰ | ′ | ″ | ‹ | › | ‼ | ‾ | ⁄ | ⁿ | ₣ | ₤ | ₧ | € | ℅ | ℓ | № | ™ | Ω | ℮ | ⅛ | ⅜ | ⅝ | ⅞ | ← | ↑ | → | ↓ | ↔ |
↕ | ↨ | ∂ | ∆ | ∏ | ∑ | − | ∕ | ∙ | √ | ∞ | ∟ | ∩ | ∫ | ≈ | ≠ | ≡ | ≤ | ≥ | ⌂ | ⌐ | ⌠ | ⌡ | ─ | │ | ┌ | ┐ | └ | ┘ | ├ | ┤ | ┬ | ┴ | ┼ | ═ | ║ |
╒ | ╓ | ╔ | ╕ | ╖ | ╗ | ╘ | ╙ | ╚ | ╛ | ╜ | ╝ | ╞ | ╟ | ╠ | ╡ | ╢ | ╣ | ╤ | ╥ | ╦ | ╧ | ╨ | ╩ | ╪ | ╫ | ╬ | ▀ | ▄ | █ | ▌ | ▐ | ░ | ▒ | ▓ | ■ |
□ | ▪ | ▫ | ▬ | ▲ | ► | ▼ | ◄ | ◊ | ○ | ● | ◘ | ◙ | ◦ | ☺ | ☻ | ☼ | ♀ | ♂ | ♠ | ♣ | ♥ | ♦ | ♪ | ♫ | | | fi | fl | � |
Kategorien
Kategorien sind anders sortiert als andere Listen. Die genaue Reihenfolge hängt von der Konfiguration des Wikis ab, über Handbuch:$wgCategoryCollation . Die Standardeinstellung seit MediaWiki 1.17 ist die Unicode Reihenfolge der Codepunkte wie oben, wobei jedoch alle Kleinbuchstaben zu Großbuchstaben werden. Komplexere Ordnungen sind möglich.
Sorting rows of a table
When a list of entries is included in a table on a page, you can use JavaScript to make the table sortable.
To do this, add the "sortable
" class to the table declaration and make sure you defined headers using exclamations marks:
{| class="wikitable sortable" |- ! Frucht !! Preis |- | Äpfel || £0.95 |- | Orangen || £0.85 |- | Birnen || £1.15 |- | Violette Mangostane || £1.05 |}
Which produces the following output:
Frucht | Preis |
---|---|
Äpfel | £0.95 |
Orangen | £0.85 |
Birnen | £1.15 |
Violette Mangostane | £1.05 |
By clicking on the buttons in the cell headers, the entries can be sorted by the value in that column, in either ascending or descending order.
Bekannte Probleme
- - It's not possible to set an initial sort preference. Für Details siehe phabricator:T33332.
Specifying a sort key
Depending on the wiki, data-sort-value
can be used to specify a sort key.
Beispiel:
{| class="wikitable sortable" ! Name und Nachname ! Höhe |- |data-sort-value="Smith, John George-Jackson"| John George-Jackson Smith | 1.85 |- |data-sort-value="Ray, Ian"| Ian Ray | 1.89 |- |data-sort-value="Bianchi, Zachary"| Zachary Bianchi | 1.72 |- |data-sort-value="Bianchi Maria, Adele"| Adele Bianchi Maria | 1.82 |- class="sortbottom" ! Durchschnitt: | 1.82 |}
ergibt:
Name and Surname | Höhe |
---|---|
John George-Jackson Smith | 1.85 |
Ian Ray | 1.89 |
Zachary Bianchi | 1.72 |
Adele Bianchi Maria | 1.82 |
Durchschnitt: | 1.82 |
Sortierung in Kategorien
Pages in categories are sorted by their title. This can be overridden by a sort key, see Help:Categories#Sort key.
Siehe auch
- For a full documentation, see Help:Sorting on Meta-Wiki.
- For much more detailed instructions, see the Wikipedia page.
- Handbuch:$wgCategoryCollation – Allows you to change the collation used for categories (requires shell access).
- Unicode character references on the Wikibooks.