Wikitable Sorting - Changing Sort Order is Broken

+7 votes

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|[ 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>[ 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 (43.6k 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

+9 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 (433k 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

+4 votes
2 answers
169 views asked Jul 28, 2018 in The Tree House by Gil Davis G2G6 Mach 1 (13.4k points)
+3 votes
1 answer
209 views asked Mar 13, 2019 in WikiTree Tech by David Wilson G2G6 Pilot (111k points)
+7 votes
3 answers
336 views asked Aug 14, 2017 in WikiTree Tech by Debi Hoag G2G6 Pilot (352k points)
+6 votes
1 answer
163 views asked Mar 8, 2019 in WikiTree Tech by Rob Judd G2G6 Pilot (101k points)
+8 votes
2 answers
+6 votes
0 answers
169 views asked Jun 25, 2018 in WikiTree Tech by Ellen Smith G2G Astronaut (1.3m points)
+2 votes
1 answer
128 views asked Jan 16, 2019 in WikiTree Tech by Living Hampson G2G6 Pilot (105k points)
+3 votes
1 answer
+14 votes
0 answers
112 views asked Mar 8, 2016 in WikiTree Tech by S Willson G2G6 Pilot (184k points)

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

disclaimer - terms - copyright