Support » Plugin: TablePress » Sorting of Special Characters

  • Resolved be_dr

    (@be_dr)


    Hi Tobias,

    when sorting rows using TablePress (with the Table Row Order extension) I find that cells starting with special characters (in this case umlauts) are placed at the end of the list. Is it possible to sort the table so that Ö follows O rather than Z. Maybe I am missing something obvious.

    Thanks.

    Grüße aus Berlin
    Oli

    http://wordpress.org/extend/plugins/tablepress/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi Oli,

    thanks for your question!

    You are probably using a Shortcode like

    [table id=123 row_order=sort row_order_sort_column=A /]

    right?

    The sorting algorithm that is used for that is a “Natural Order String Comparison”, using a PHP function: http://php.net/strnatcasecmp

    Unfortunately, I don’t know if this function can be altered to sort Umlauts at different positions, and there doesn’t seem to be a hint on this in the PHP documentation 🙁 Sorry.

    Regards,
    Tobias

    Hi Tobias,

    thanks for getting back to me. Yes, that is the Shortcode I am using. Okay, that’s a shame that it’s not an easy fix. However, many lists are sortable in the way I would like so I am sure there is some way of doing it. Maybe it will involve saving the initial data in another format. Thanks for the tip anyway and I will let you know if I find an answer!

    Oli

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Oli,

    the table data is stored as a two-dimensional array. So, the sorting algorithm should be able to deal with that.
    And yes, if you find something, please let me know. I’ll then gladly help to integrate it into the Extension.

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi again 🙂

    One idea: It might be possible that PHP uses the configured locale or language of the server to alter the behavior of the sorting. So, maybe there’s a way to change that locale in the config, to alter the sorting behavior…

    Regards,
    Tobias

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sorting of Special Characters’ is closed to new replies.