Include full page in book overview. #2402

Closed
opened 2026-02-05 03:58:09 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @Kimzi on GitHub (Sep 22, 2021).

Hi!

This is not really a feature request, as this worked before when using the theme system. More of a question as I do not have Discord.
Since the last update this stopped working, and I was just wondering how I'd do it now?

In list-item.blade.php under themes\custom\pages I got these lines to render the html of a page directly in the book overview, after the latest update this does not work anymore. It does not render anything, if I look at the $page variable it does not seem to be included anymore?

@if ( $page->name == 'Infobox') {!! isset($page->renderedHTML) ? $page->renderedHTML : $page->HTML !!}

Originally created by @Kimzi on GitHub (Sep 22, 2021). Hi! This is not really a feature request, as this worked before when using the theme system. More of a question as I do not have Discord. Since the last update this stopped working, and I was just wondering how I'd do it now? In list-item.blade.php under themes\custom\pages I got these lines to render the html of a page directly in the book overview, after the latest update this does not work anymore. It does not render anything, if I look at the $page variable it does not seem to be included anymore? `@if ( $page->name == 'Infobox') {!! isset($page->renderedHTML) ? $page->renderedHTML : $page->HTML !!}`
Author
Owner

@ssddanbrown commented on GitHub (Sep 23, 2021):

Hi @Kimzi,
This file was moved recently.

It's now found at pages/parts/list-item.blade.php Reference.

Try moving your own version to a themes\custom\pages\parts folder and see how that goes.

@ssddanbrown commented on GitHub (Sep 23, 2021): Hi @Kimzi, This file was moved recently. It's now found at `pages/parts/list-item.blade.php` [Reference](https://github.com/BookStackApp/BookStack/blob/master/resources/views/pages/parts/list-item.blade.php). Try moving your own version to a `themes\custom\pages\parts` folder and see how that goes.
Author
Owner

@Kimzi commented on GitHub (Sep 23, 2021):

Hi @ssddanbrown,
Thank you, now it seems to be rendering something, but $page->HTML still doesn't work.

If I do something like this :
@if ( $page->name == 'Infobox') <div class="entity-item-infobox"> {!! isset($page->renderedHTML) ? $page->renderedHTML : $page->HTML !!} <a class="edit-infobox" href="{{ $page->getUrl() }}/edit">Edit infobox</a> </div>

It does render the div and link at least, so now I know it uses my list-item.blade.php again.

@Kimzi commented on GitHub (Sep 23, 2021): Hi @ssddanbrown, Thank you, now it seems to be rendering something, but $page->HTML still doesn't work. If I do something like this : `@if ( $page->name == 'Infobox') <div class="entity-item-infobox"> {!! isset($page->renderedHTML) ? $page->renderedHTML : $page->HTML !!} <a class="edit-infobox" href="{{ $page->getUrl() }}/edit">Edit infobox</a> </div>` It does render the div and link at least, so now I know it uses my list-item.blade.php again.
Author
Owner

@ssddanbrown commented on GitHub (Sep 25, 2021):

@Kimzi Ah, I stopped loading HTML content for pages in list views for DB loading efficiency.
You could force all page info to be reloaded via:

{!! $page->renderedHTML ?? $page->refresh()->html !!}

Bit of an efficiency loss but might not notice any impact.
Note, You should only be using the direct HTML like that if content is edited by trusted users.
Direct use of the html property does not do any filtering like the page view.

@ssddanbrown commented on GitHub (Sep 25, 2021): @Kimzi Ah, I stopped loading HTML content for pages in list views for DB loading efficiency. You could force all page info to be reloaded via: ```php {!! $page->renderedHTML ?? $page->refresh()->html !!} ``` Bit of an efficiency loss but might not notice any impact. Note, You should only be using the direct HTML like that if content is edited by trusted users. Direct use of the `html` property does not do any filtering like the page view.
Author
Owner

@Kimzi commented on GitHub (Sep 29, 2021):

@ssddanbrown Thank you so much, that worked. :)
Dunno if you want any backstory, but I'm using this for applications, and for each application(book) I want to display an infobox, like the most important info directly and this is how I solved it when I started using Bookstack during Beta.
I love it !

@Kimzi commented on GitHub (Sep 29, 2021): @ssddanbrown Thank you so much, that worked. :) Dunno if you want any backstory, but I'm using this for applications, and for each application(book) I want to display an infobox, like the most important info directly and this is how I solved it when I started using Bookstack during Beta. I love it !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2402