• Resolved mobilekaraokeunit

    (@mobilekaraokeunit)


    I have a table of songs and artists. Some of the songs start with a parenthesis, hashtag, or other special character. When sorting, these songs show up first. Is there a way to ignore these special characters so the songs are sorted alphabetically by the first actual letter in the title?

    Example: I want the song “(Keep Feeling) Fascination” to sort with other K songs, rather than at the beginning of the list before the A songs.

    https://www.ads-software.com/plugins/tablepress/

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Unfortunately, I’m not aware of a direct solution here. The reason for why the sorting algorithm puts the special characters first is simply that they come first in the extended “alphabet” that a computer uses (called character encoding).
    If you basically want to ignore them, you’d have to develop a custom sorting algorithm that strips them before performing the sorting. For that, you’ll need to take a look at the API functions of the external DataTables JavaScript library from https://www.datatables.net/ that TablePress uses for the sorting.

    Regards,
    Tobias

    Thread Starter mobilekaraokeunit

    (@mobilekaraokeunit)

    Thanks for the quick response. That seems a bit above my skill level. I can live with it the way it is.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yeah, it’s not trivial at all, otherwise the DataTables developer would likely have added support for it.
    Sorry that I couldn’t provide a direct solution here.

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Thread Starter mobilekaraokeunit

    (@mobilekaraokeunit)

    Done and done! Five stars for sure. It’s a great plugin.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks, I really appreciate that!

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Ignore special characters when sorting’ is closed to new replies.