Bookstack: Force books to be in a shelf

Created on 10 Dec 2018  Â·  10Comments  Â·  Source: BookStackApp/BookStack

Describe the feature you'd like
Books should be in exactly one shelf. This would mean that we could remove the "Books" navigation item in the navigation bar, and create books from within a shelf.

Smaller wikis should be able to disable shelves completely, just leaving (internally) a single shelf with the same name as the wiki.

Having both a "Shelves" and "Books" menu item seems confusing to me, as I have a hard time figuring out where to put what in a new wiki (e.g. "I want to create a book in a shelf" → I have to create a book, then go to the shelf, then add the book to the shelf, then go back to the shelf permissions, then copy the permissions to apply them to the new book).

Describe the benefits this feature would bring to BookStack users
Basically: enforcing a better structure for a wiki, and making the navigation bar cleaner and less confusing. Also solves stuff like #1077

This would also more closesly resemble the real-life situation - I wouldn't exactly call it good structure to just have books lying around (like it's currently the case), or to have the same book twice in different shelves. Simultaneously, if there are only a few books, there's no need to tell in which shelf to look as there's only a single one.

If BookStack wants to enforce the book-based structure, having shelves be mandatory (except if only one of them is needed) is important in my opinion.

Question: is there any specific use case why a book can be in more than one shelf?

Open to discussion Feature Request

All 10 comments

Question: is there any specific use case why a book can be in more than one shelf?

I am convinced there is for bigger teams with enough experience. But I understand your issue and I support your idea, that it should be possible to deactivate the shelves. But you can do a lot here already, just strike of all permissions for shelves and then remove the shelf link with a custom css code in the settings field. I did this for a smaller team and it works without problems.

But, in my opinion, the bigger the wiki is, the more important a good structure gets - having stuff twice in that structure seems like a bad thing to me, just as having stuff that's not part of the structure at all.
I know that I can disable shelves that way, I just don't have the feeling that they are an integral structural element right now.

and then remove the shelf link with a custom css code in the settings field

The header link will actually automatically hide once permissions are removed so no CSS should be needed unless you also want to hide for admin users.

I just don't have the feeling that they are an integral structural element right now

They are not. They are kind of designed to be optional, In a way to fit in with how BookStack was already being used. As an extra layer as you grow your instance.

The multi-book relation is to provide another structural option to users & to give bookshelves their own unique ability rather than just being another container. Think of them more as a category than a folder, In a similar way a bookshelf at a library may be used.

Hm, I see. Would it be possible though to add a "Create new book" button inside a Bookshelf (if the user has the create permission for that shelf)? I think that would make using bookshelves a lot less confusing to new users already, and it would still be possible to create books without shelves and with multiple shelves.

I'd like to suggest an additional usecase. Bookshelves can be used as containers specific to a team or department. It would be good if we could enforce (via configuration) any new book created to be part of at least one bookshelf so that we could ensure a book can't exist as an orphan outside the teams/departments container. It essentially becomes an enforced categorisation which is valuable when dealing with a large number of distinct teams and/or departments.

Maybe we could also make it Books are in a Bookshelf instead of Bookshelves contain Books in the UI, so I select the bookshelves a book is in on the book site (like with categories everywhere else). That way, it would be easy to implement a toggleable option to enforce "must be in at least one shelf".

I've got an idea that would integrate with the existing philosophy quite well in my opinion:

  • the book's "edit" page gives the possibility to select which shelves it belongs to

    • there's still the possibility to define which books are in a shelf from the shelf's "edit" page like right now

  • the page of a shelf has a button "Create book" in the top right corner, which creates a book that has that shelf pre-selected in that shelf selection
  • there is an option to only show unsorted (not in any shelf) books on the 'Books' page (APP_HIDE_SORTED_BOOKS=1)
  • there is an option to hide the "books" page completely if it's empty (APP_HIDE_SORTED_BOOKS=2)

Now, if there is no unsorted book, it is only possible to create books from shelves. It would still be possible to remove books from all shelves, making the "Books" page show up again, but it would be a simple solution that would require only one option that hides stuff with various conditions, one button and one additional selection that additionally solves #1077.

the page of a shelf has a button "Create book" in the top right corner, which creates a book that has that shelf pre-selected in that shelf selection

As of the last release, There is now a button to create a book directly within a shelf.

I have managed to create a lot of books that are not on a shelf. Is there a way to move these to a shelf without having to go into mySQL?

@eina84 Edit/Create a shelf and you'll have the option to add multiple books to the shelf.

Was this page helpful?
0 / 5 - 0 ratings