Dynamic link generation for internal links #1496

Closed
opened 2026-02-05 01:03:22 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @rocnetBinarian on GitHub (Jan 14, 2020).

Currently, BookStack has a (very neat) "Entity Selection" tool that lets you link to another page within the same bookstack installation. Unfortunately, once that link is created, it is hardcoded into the page being edited.

In most cases, that is probably sufficient. However, I am currently in a situation where I need to change the domain name upon which bookstack is hosted. While changing the appropriate setting in the .env file does update the general assets correctly, the internal links do not change. This means that after I update the domain, I will need to go through every single page and update every single internal link.

Suggested Feature
Have any links created by the "Entity Selector" link generator be a dynamically-created link. This will allow migrating to a new domain to work without manual intervention.

Additional Comments
I suspect this feature would also affect links that point to pages which later have their names changed. Finally, the comment regarding APP_URL in the .env file states

All URL's in BookStack will be generated using this value

Given that internal links are not dynamic, this is at best misleading, and at worst incorrect.

Originally created by @rocnetBinarian on GitHub (Jan 14, 2020). Currently, BookStack has a (very neat) "Entity Selection" tool that lets you link to another page within the same bookstack installation. Unfortunately, once that link is created, it is hardcoded into the page being edited. In most cases, that is probably sufficient. However, I am currently in a situation where I need to change the domain name upon which bookstack is hosted. While changing the appropriate setting in the .env file does update the general assets correctly, the internal links do not change. This means that after I update the domain, I will need to go through every single page and update every single internal link. **Suggested Feature** Have any links created by the "Entity Selector" link generator be a dynamically-created link. This will allow migrating to a new domain to work without manual intervention. **Additional Comments** I suspect this feature would _also_ affect links that point to pages which later have their names changed. Finally, the comment regarding APP_URL in the .env file states > All URL's in BookStack will be generated using this value Given that internal links are not dynamic, this is at best misleading, and at worst incorrect.
OVERLORD added the :cat2:🐈 Possible duplicate label 2026-02-05 01:03:22 +03:00
Author
Owner

@mflagler commented on GitHub (Feb 21, 2020):

I agree that this should be implemented. I was recently going to link to some other pages, but once I noticed that the URL was going to be static, I stopped and didn't bother as I or someone else could potentially be re-organizing the pages/chapters/books the pages I was linking to were in. If they had a placeholder like [page:27] or [book:12] to reference that it's a link to the page with a unique ID of 27 or book with a unique ID of 12, then no matter where pages/books/chapters are moved, the link would always work. (And maybe even allow the text of the link to be dynamic as well so that if the title is changed, the link text updates).

To take this a step further, it would be great to be able to link to bookmarks/headings internal to the page easily while editing as either part of the search or as a separate search button/function on the link popup.

@mflagler commented on GitHub (Feb 21, 2020): I agree that this should be implemented. I was recently going to link to some other pages, but once I noticed that the URL was going to be static, I stopped and didn't bother as I or someone else could potentially be re-organizing the pages/chapters/books the pages I was linking to were in. If they had a placeholder like [page:27] or [book:12] to reference that it's a link to the page with a unique ID of 27 or book with a unique ID of 12, then no matter where pages/books/chapters are moved, the link would always work. (And maybe even allow the text of the link to be dynamic as well so that if the title is changed, the link text updates). To take this a step further, it would be great to be able to link to bookmarks/headings internal to the page easily while editing as either part of the search or as a separate search button/function on the link popup.
Author
Owner

@ssddanbrown commented on GitHub (Feb 21, 2020):

Thank you for this request @rocnetBinarian.
Since this feature has fundementally already been covered by #732 I'm going to close this off to reduce duplicate issues.

@mflagler I know this is not exactly what you've requested, but it might help if you have not yet found this, if you select text in a section when viewing a page you'll get a pop-over that provides a permalink (Page ID-based instead of slug based) that links directly to the section selected:

image

@ssddanbrown commented on GitHub (Feb 21, 2020): Thank you for this request @rocnetBinarian. Since this feature has fundementally already been covered by #732 I'm going to close this off to reduce duplicate issues. @mflagler I know this is not exactly what you've requested, but it might help if you have not yet found this, if you select text in a section when viewing a page you'll get a pop-over that provides a permalink (Page ID-based instead of slug based) that links directly to the section selected: ![image](https://user-images.githubusercontent.com/8343178/74985151-ce9f5a00-542e-11ea-9e70-fad2ac04ac84.png)
Author
Owner

@mflagler commented on GitHub (Feb 21, 2020):

Yeah, I knew I could do that, but while editing the page, there's no way to do it unless you open the page in a separate tab and switch back and forth. I was just hoping/wishing for a way to link it without swapping around and only really needing/hoping for headings/sections instead of absolutely any content.

@mflagler commented on GitHub (Feb 21, 2020): Yeah, I knew I could do that, but while editing the page, there's no way to do it unless you open the page in a separate tab and switch back and forth. I was just hoping/wishing for a way to link it without swapping around and only really needing/hoping for headings/sections instead of absolutely any content.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1496