Proper Name sort option #5355

Open
opened 2026-02-05 10:00:04 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @profiteroles1 on GitHub (Jul 10, 2025).

Describe the feature you'd like

Hi there, we have a number of large books with a naming convention in which the proper name of a person is used to title a page. One of my favorite features of BookStack is the sort rules interface, which allows the creation of powerful auto-sort rules to be applied to various books.

I was hoping it might be possible to add a "proper name" sort option to the list of options. This would take the string, explode by " " characters, and use the last entry as the alpha sort (this should work for middle names, eg. John Smith and John Thomas Smith are both sorted with "Sm").

Describe the benefits this would bring to existing BookStack users

Better auto sorting for books with many proper names

Can the goal of this request already be achieved via other means?

No

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

1 to 5 years

Additional context

No response

Originally created by @profiteroles1 on GitHub (Jul 10, 2025). ### Describe the feature you'd like Hi there, we have a number of large books with a naming convention in which the proper name of a person is used to title a page. One of my favorite features of BookStack is the sort rules interface, which allows the creation of powerful auto-sort rules to be applied to various books. I was hoping it might be possible to add a "proper name" sort option to the list of options. This would take the string, explode by " " characters, and use the last entry as the alpha sort (this should work for middle names, eg. John Smith and John Thomas Smith are both sorted with "Sm"). ### Describe the benefits this would bring to existing BookStack users Better auto sorting for books with many proper names ### Can the goal of this request already be achieved via other means? No ### Have you searched for an existing open/closed issue? - [x] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? 1 to 5 years ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 10:00:04 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 11, 2025):

Thanks @profiteroles1,

Is sounds like this is quite scenario/use-case specific. For something like this I'd not want to implement it unless there's a wider proven need.

Maybe if others have different scenario/use-case specific requirements it might be an idea for us a add a way to define custom sort rule actions via the logical theme system.

@ssddanbrown commented on GitHub (Jul 11, 2025): Thanks @profiteroles1, Is sounds like this is quite scenario/use-case specific. For something like this I'd not want to implement it unless there's a wider proven need. Maybe if others have different scenario/use-case specific requirements it might be an idea for us a add a way to define custom sort rule actions via [the logical theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md).
Author
Owner

@profiteroles1 commented on GitHub (Jul 17, 2025):

Thanks @profiteroles1,

Is sounds like this is quite scenario/use-case specific. For something like this I'd not want to implement it unless there's a wider proven need.

Maybe if others have different scenario/use-case specific requirements it might be an idea for us a add a way to define custom sort rule actions via the logical theme system.

Hi @ssddanbrown, sure if such a thing is possible, that would be much appreciated. I just figured since there is an extensive nested sort system already in place, adding a few additional sort options wouldn't crowd the UI or disturb anyone. I can't imagine we're the only users who have a list of books, pages or chapters titled after people, who would benefit from being able to see those proper names listed in alphabetical order, rather than by first name.

@profiteroles1 commented on GitHub (Jul 17, 2025): > Thanks [@profiteroles1](https://github.com/profiteroles1), > > Is sounds like this is quite scenario/use-case specific. For something like this I'd not want to implement it unless there's a wider proven need. > > Maybe if others have different scenario/use-case specific requirements it might be an idea for us a add a way to define custom sort rule actions via [the logical theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md). Hi @ssddanbrown, sure if such a thing is possible, that would be much appreciated. I just figured since there is an extensive nested sort system already in place, adding a few additional sort options wouldn't crowd the UI or disturb anyone. I can't imagine we're the only users who have a list of books, pages or chapters titled after people, who would benefit from being able to see those proper names listed in alphabetical order, rather than by first name.
Author
Owner

@profiteroles1 commented on GitHub (Jul 25, 2025):

@ssddanbrown Can you point me in a direction here? We have many, many books full of pages of proper names that look like this:

• Vanessa Smith
• Adam Jones
• Michael Harrington

Currently they sort like this:

• Adam Jones
• Michael Harrington
• Vanessa Smith

We need to sort like this:

• Michael Harrington
• Adam Jones
• Vanessa Smith

I'd really appreciate even a few lines of code or a reference to a file so I can try to hack this myself.

@profiteroles1 commented on GitHub (Jul 25, 2025): @ssddanbrown Can you point me in a direction here? We have many, many books full of pages of proper names that look like this: • Vanessa Smith • Adam Jones • Michael Harrington Currently they sort like this: • Adam Jones • Michael Harrington • Vanessa Smith We need to sort like this: • Michael Harrington • Adam Jones • Vanessa Smith I'd really appreciate even a few lines of code or a reference to a file so I can try to hack this myself.
Author
Owner

@ssddanbrown commented on GitHub (Jul 25, 2025):

@profiteroles1 That part of the code is not really made extensible. The core sort function logic is here: 841350a937/app/Sorting/SortSetOperationComparisons.php

It would probably be easier to hack in an alternative option, following similar logic to our prior hack here:
https://www.bookstackapp.com/hacks/autosort-tagged-books/

@ssddanbrown commented on GitHub (Jul 25, 2025): @profiteroles1 That part of the code is not really made extensible. The core sort function logic is here: https://github.com/BookStackApp/BookStack/blob/841350a937b98bb6a6025279a7afe3d9e33c2696/app/Sorting/SortSetOperationComparisons.php It would probably be easier to hack in an alternative option, following similar logic to our prior hack here: https://www.bookstackapp.com/hacks/autosort-tagged-books/
Author
Owner

@profiteroles1 commented on GitHub (Jul 30, 2025):

@profiteroles1 That part of the code is not really made extensible. The core sort function logic is here: 841350a937/app/Sorting/SortSetOperationComparisons.php

It would probably be easier to hack in an alternative option, following similar logic to our prior hack here: https://www.bookstackapp.com/hacks/autosort-tagged-books/

Hi Dan, thanks for the info. You're saying this code could or could not be overridden or extended with the template system? Would these hacks persist upgrades? I am still holding out hope that expanding the official sort options of the app would be seen as a welcome improvement to other users.

@profiteroles1 commented on GitHub (Jul 30, 2025): > [@profiteroles1](https://github.com/profiteroles1) That part of the code is not really made extensible. The core sort function logic is here: https://github.com/BookStackApp/BookStack/blob/841350a937b98bb6a6025279a7afe3d9e33c2696/app/Sorting/SortSetOperationComparisons.php > > It would probably be easier to hack in an alternative option, following similar logic to our prior hack here: https://www.bookstackapp.com/hacks/autosort-tagged-books/ Hi Dan, thanks for the info. You're saying this code could or could not be overridden or extended with the template system? Would these hacks persist upgrades? I am still holding out hope that expanding the official sort options of the app would be seen as a welcome improvement to other users.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5355