Reusing Page Content - Allow explicit deep-includes (including working hack to do this now) #2895

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

Originally created by @NeurohrByteS on GitHub (Jul 8, 2022).

Describe the feature you'd like

Setting. Two includes: page-include / block-include (a copyright note). The block-include is already included in the page-include.

  • When importing a complete page with pre-existing block-include, the include tags get printed out, instead of resolved.
    • That was expected: I remembered that you can't have recursive includes and started to rebuild the pages

Documentation:

Note that the include behaviour is non-recursive so including will only work to a single level. This ensures performance and prevents users from breaking pages by creating include loops.

  • When I included the unresolved text-block after the page-include, the original include from the page-include also resolved (i.e. I had two copyright-notes on the page).
  • Now I just changed the text-block-include to style="display: none;" and have a full copy of the other page, including the copyright note.

My idea is: Maybe I could provide a list of includes to the page editor. This still prevents loops and performance issues, because it moves the processing power for iterating through all pages to my brain: I have to explicitly list all imports.

Describe the benefits this would bring to existing BookStack users

I personally think that the reusing page content function is an important function and this could make it even more useful for advanced users.

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

Yes, by changing the surrounding paragraph of the import-tag with style="display: none;" you can add deep-imports to a page without changing what the reader sees.

I haven't tested it with multiple layers. but I guess it would work.

Have you searched for an existing open/closed issue?

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

How long have you been using BookStack?

0 to 6 months

Additional context

No response

Originally created by @NeurohrByteS on GitHub (Jul 8, 2022). ### Describe the feature you'd like Setting. Two includes: page-include / block-include (a copyright note). The block-include is already included in the page-include. + When importing a complete page with pre-existing block-include, the include tags get printed out, instead of resolved. + That was expected: I remembered that you can't have recursive includes and started to rebuild the pages [Documentation](https://www.bookstackapp.com/docs/user/reusing-page-content/): > Note that the include behaviour is non-recursive so including will only work to a single level. This ensures performance and prevents users from breaking pages by creating include loops. + When I included the unresolved text-block after the page-include, the original include from the page-include also resolved (i.e. I had two copyright-notes on the page). + Now I just changed the text-block-include to `style="display: none;"` and have a full copy of the other page, including the copyright note. My idea is: Maybe I could provide a list of includes to the page editor. This still prevents loops and performance issues, because it moves the processing power for iterating through all pages to my brain: I have to explicitly list all imports. ### Describe the benefits this would bring to existing BookStack users I personally think that the reusing page content function is an important function and this could make it even more useful for advanced users. ### Can the goal of this request already be achieved via other means? Yes, by changing the surrounding paragraph of the import-tag with `style="display: none;"` you can add deep-imports to a page without changing what the reader sees. I haven't tested it with multiple layers. but I guess it would work. ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundemental request ### How long have you been using BookStack? 0 to 6 months ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 05:39:04 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 8, 2022):

Hi @NeurohrByteS,

So from what I understand you want to allow nested includes when explicitly listed by the author within the page?
Personally I don't see that as a viable alternative to just adding nested inclusions, since all the same concerns would still apply since we can't really trust the original author to avoid these issues themselves. In addition, this requires some additional abstraction and potential maintenance for the author to follow/know/assume (In terms of updating the listed includes if child content changes).

@ssddanbrown commented on GitHub (Jul 8, 2022): Hi @NeurohrByteS, So from what I understand you want to allow nested includes when explicitly listed by the author within the page? Personally I don't see that as a viable alternative to just adding nested inclusions, since all the same concerns would still apply since we can't really trust the original author to avoid these issues themselves. In addition, this requires some additional abstraction and potential maintenance for the author to follow/know/assume (In terms of updating the listed includes if child content changes).
Author
Owner

@NeurohrByteS commented on GitHub (Jul 8, 2022):

@ssddanbrown Thank you for your response!

Hmm... I see the problem. It depends on the knowledge and accuracy of the authors too much (which is okay for us, since only a small team of authors handles everything). I forgot that the source could change in all but such simple cases as a legal note / static content block.

In that case the style="display: none;" hack works for us.

Hmm... what could be a working solution is that there is a global list of pages (without any nesting) which can always be included, even with deep-includes.
However that feels like more effort than is worth it for "default page header" or "default page footer".

I think we can close this request.

@NeurohrByteS commented on GitHub (Jul 8, 2022): @ssddanbrown Thank you for your response! Hmm... I see the problem. It depends on the knowledge and accuracy of the authors too much (which is okay for us, since only a small team of authors handles everything). I forgot that the source could change in all but such simple cases as a legal note / static content block. In that case the `style="display: none;"` hack works for us. Hmm... what could be a working solution is that there is a global list of pages (without any nesting) which can always be included, even with deep-includes. However that feels like more effort than is worth it for "default page header" or "default page footer". I think we can close this request.
Author
Owner

@ssddanbrown commented on GitHub (Jul 13, 2022):

Alrighty, will therefore close this issue.

@ssddanbrown commented on GitHub (Jul 13, 2022): Alrighty, will therefore close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2895