Wikitable Sorting - Changing Sort Order is Broken

+8 votes
364 views

When you make a wikitable and add a sort key to a cell as described on Wikipedia here, WikiTree ignores it and sorts by the contents of the cell (after stripping out tags).

For example, this cell will sort as text value "9th cousins" instead of as 09.0900 as the data-sort-value specified.

|data-sort-value=09.0900|[https://www.wikitree.com/index.php?title=Special:Relationship&action=calculate&person1_name=Ryker-100&person2_name=Cooper-1 9th cousins]

Also, this cell will sort as the text value "George Abbott" instead of as "Abbott, George" as the data-sort-value specified.

|data-sort-value="Abbott, George"|[[Abbott-307|George Abbott]]

As a work-around, I had to trick the sorting function by adding a hidden span like this:

|data-sort-value=09.0900|<span style="display:none">09.0900</span>[https://www.wikitree.com/index.php?title=Special:Relationship&action=calculate&person1_name=Ryker-100&person2_name=Cooper-1 9th cousins]

Can someone who can stick their hands in the inner workings of the Wiki part of WikiTree take a look at why this basic sorting feature is broken in WikiTree?

in WikiTree Tech by Richard Ryker G2G6 Mach 4 (49.2k points)
retagged by Ellen Smith

There are many features of wiki-markup that are implemented at Wikipedia that have not been enabled at WikiTree. The sort key functionality you describe apparently is one of them. The functionality doesn't work here because it doesn't exist here.

So this isn't a bug. Rather, it's a potential future improvement.

1 Answer

+11 votes

Hi, Richard --

Ellen is correct about some of the functionality you might find on Wikipedia not working here. We are using an older version of the wiki software, and the functionality you're referring to may not be included in our version, or it may just not be enabled.

However, I make sortable wiki tables all the time by using the class "wikitable sortable."

You just have to make sure that you don't have any stray spaces in your cells when you use that class or you'll get unpredictable sort results.

Here's an example of a sortable table I set up: My Cousin Table, and here are the parameters I used to create it:

{| class="wikitable sortable" border="1" cellpadding="4" width="100%"

Hope that helps!

 

p.s. In my rush, I neglected to go look at your table before I wrote that. ;-)  I see that you're using the "wikitable sortable" class already. I will add, though, that we don't have control over how the wiki markup works in this type of situation.

If you'd like to look at the details of how I have my cousin table set up, let me know, and I'll add you to the trusted list for a bit.

by Julie Ricketts G2G6 Pilot (487k points)
edited by Julie Ricketts
You can see in my post that I have found a workaround for not being able to use the data-sort-value to change how a column sorts. But it is a workaround that wiki developers say is deprecated and shouldn't be used.
So how does their thing work then?  If the sorting is done in Javascript, then two different strings have to be passed to the browser, one to display and one to sort.

Yes, that is where the data-sort-value comes in.

|data-sort-value="Ryker, Richard"|[[Ryker-100|Richard Ryker]]

This is supposed to sort using last name then first name because that is my data-sort-value for that cell.

Related questions

+6 votes
2 answers
246 views asked Jul 28, 2018 in The Tree House by Gil Davis G2G6 Mach 1 (14.7k points)
+3 votes
1 answer
248 views asked Mar 13, 2019 in WikiTree Tech by David Wilson G2G6 Pilot (122k points)
+8 votes
3 answers
459 views asked Aug 14, 2017 in WikiTree Tech by Debi Hoag G2G6 Pilot (396k points)
+8 votes
1 answer
183 views asked Mar 8, 2019 in WikiTree Tech by Robert Judd G2G6 Pilot (134k points)
+10 votes
2 answers
+6 votes
0 answers
194 views asked Jun 25, 2018 in WikiTree Tech by Ellen Smith G2G Astronaut (1.5m points)
+4 votes
1 answer
137 views asked Jan 16, 2019 in WikiTree Tech by Living Hampson G2G6 Pilot (113k points)
+5 votes
1 answer
+15 votes
0 answers
124 views asked Mar 8, 2016 in WikiTree Tech by S Willson G2G6 Pilot (223k points)

WikiTree  ~  About  ~  Help Help  ~  Search Person Search  ~  Surname:

disclaimer - terms - copyright

...