From: Dan Brown Date: Fri, 12 Jul 2024 14:01:51 +0000 (+0100) Subject: Updated autosort tagged books hack X-Git-Url: http://source.bookstackapp.com/hacks/commitdiff_plain/2d25a8b4f7e9423dfae49e6cc720fb17f1c6af11 Updated autosort tagged books hack Upon request via hack update service --- diff --git a/content/autosort-tagged-books/functions.php b/content/autosort-tagged-books/functions.php index 1137569..df5ec7c 100644 --- a/content/autosort-tagged-books/functions.php +++ b/content/autosort-tagged-books/functions.php @@ -1,6 +1,6 @@ chapters()->orderBy('name', 'asc')->get(['id', 'priority']); $pages = $book->pages()->orderBy('name', 'asc') ->where('draft', '=', false) @@ -51,5 +51,4 @@ Theme::listen(ThemeEvents::ACTIVITY_LOGGED, function (string $type, $detail) { autoSortBook($detail->book); } } - -}); \ No newline at end of file +}); diff --git a/content/autosort-tagged-books/index.md b/content/autosort-tagged-books/index.md index 6feb2da..c7d4874 100644 --- a/content/autosort-tagged-books/index.md +++ b/content/autosort-tagged-books/index.md @@ -2,11 +2,10 @@ title = "Autosort Tagged Books" author = "@ssddanbrown" date = 2023-01-23T20:00:00Z -updated = 2023-01-23T20:00:00Z -tested = "v22.11.1" +updated = 2024-07-12T14:00:00Z +tested = "v24.05.2" +++ - This is a hack to BookStack to enable auto-sorting of book chapters and pages upon page or chapter create/update. It sorts by name, ascending, with chapters first. By default it will run for any book with an `Autosort` tag assigned. #### Options