Is there a way to alter the URIs? #3900

Closed
opened 2026-02-05 07:48:53 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @mrxkon on GitHub (Jul 5, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hey there,

Is there maybe a way to customize the URIs and include the shelves also? The usecase here is that as we're using BookStack for our internal docs and there are multiple "Support" teams for each product that we have (since we categorize everything by product). So the set up ended up being like this (in a toned down version):

  • Product 1 [ shelf ]
    • Support [book]
    • Developers [books]
  • Product 2 [shelf]
    • Support [book]
    • Developers [book]

All the links to the books now would essentially just be https://site.com/books/support-[random-number] , which is ok in general but it would be really nice to be able to include the shelf name also to avoid a bit of confusion when we're just sharing links between us.

Would there be a way to maybe end up having something like https://site.com/{shelf}/{book} , or https://site.com/{shelf}/books/{book} even?

I don't mind manually editing a couple of files, if that's what it'd take, if there's a way to achieve this (without permanently breaking everything haha) and keeping it maintained on our setup throughout newer updates.

Cheers!

Exact BookStack Version

v23.06

Log Content

No response

PHP Version

No response

Hosting Environment

Ubuntu 22.04

Originally created by @mrxkon on GitHub (Jul 5, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Hey there, Is there maybe a way to customize the URIs and include the shelves also? The usecase here is that as we're using BookStack for our internal docs and there are multiple "Support" teams for each product that we have (since we categorize everything by product). So the set up ended up being like this (in a toned down version): - Product 1 [ shelf ] - Support [book] - Developers [books] - Product 2 [shelf] - Support [book] - Developers [book] All the links to the books now would essentially just be https://site.com/books/support-[random-number] , which is ok in general but it would be really nice to be able to include the shelf name also to avoid a bit of confusion when we're just sharing links between us. Would there be a way to maybe end up having something like https://site.com/{shelf}/{book} , or https://site.com/{shelf}/books/{book} even? I don't mind manually editing a couple of files, if that's what it'd take, if there's a way to achieve this (without permanently breaking everything haha) and keeping it maintained on our setup throughout newer updates. Cheers! ### Exact BookStack Version v23.06 ### Log Content _No response_ ### PHP Version _No response_ ### Hosting Environment Ubuntu 22.04
OVERLORD added the 🐕 Support label 2026-02-05 07:48:53 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 5, 2023):

Hi @mrxkon,

There's no officially support way to specifically alter URLs.
You can use our logical theme system to define custom endpoints.
See my comment in this thread for a similar use-case, where the logical theme system is used.

You may also need to use the visual theme system to override the views where the existing URLs are used, like this one for example. Other usages may be a little bit complex where the template is shared with views that are not specifically within a shelf context.

Note that these systems keep edits/customisations seperate, but they can break since the BookStack internals they'd interact with are not considered a stable/supported API.

@ssddanbrown commented on GitHub (Jul 5, 2023): Hi @mrxkon, There's no officially support way to specifically alter URLs. You can use our [logical theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md) to define custom endpoints. See [my comment in this thread](https://github.com/BookStackApp/BookStack/issues/497#issuecomment-1096524204) for a similar use-case, where the logical theme system is used. You may also need to use the [visual theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/visual-theme-system.md) to override the views where the existing URLs are used, like [this one for example](https://github.com/BookStackApp/BookStack/blob/18979e84d6c6f462f07ba6939dc11955b65e81d1/resources/views/shelves/parts/list-item.blade.php#L15). Other usages may be a little bit complex where the template is shared with views that are not specifically within a shelf context. Note that these systems keep edits/customisations seperate, but they can break since the BookStack internals they'd interact with are not considered a stable/supported API.
Author
Owner

@mrxkon commented on GitHub (Jul 5, 2023):

Ah great, @ssddanbrown !

I'll definitely take a look and see what I can come up with, keep up the excellent work and thanks for everything!

@mrxkon commented on GitHub (Jul 5, 2023): Ah great, @ssddanbrown ! I'll definitely take a look and see what I can come up with, keep up the excellent work and thanks for everything!
Author
Owner

@ssddanbrown commented on GitHub (Jul 5, 2023):

@mrxkon Thanks, happy to help.

If you need any general pointers regarding achieving things or the BookStack internals free free to continue to @ me in this thread, or otherwise query in the dev channels of our discord server.

@ssddanbrown commented on GitHub (Jul 5, 2023): @mrxkon Thanks, happy to help. If you need any general pointers regarding achieving things or the BookStack internals free free to continue to `@` me in this thread, or otherwise query in the dev channels of our discord server.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3900