Customizing a specific view #2881

Closed
opened 2026-02-05 05:35:21 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @memo-567 on GitHub (Jun 27, 2022).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I'm pretty sure it's simple, but I'm confused about the directory and file structure.
As can be seen on the photo montage, I would like the respective cover to be displayed in the individual view of an item.
Any help would be great

20220627-0623
.

Exact BookStack Version

BookStack v22.06.1

Log Content

No response

PHP Version

No response

Hosting Environment

Debian 11 Bullseye

Originally created by @memo-567 on GitHub (Jun 27, 2022). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I'm pretty sure it's simple, but I'm confused about the directory and file structure. As can be seen on the photo montage, I would like the respective cover to be displayed in the individual view of an item. Any help would be great ![20220627-0623](https://user-images.githubusercontent.com/58190287/175908017-9f63821f-3cad-489b-9d88-4d54e68e8158.jpg) . ### Exact BookStack Version BookStack v22.06.1 ### Log Content _No response_ ### PHP Version _No response_ ### Hosting Environment Debian 11 Bullseye
OVERLORD added the 🐕 Support label 2026-02-05 05:35:21 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jun 27, 2022):

Hi @memo-567,
I responded on discord but thought I'd copy my response here and expand on it a little:

You could use the visual theme system to override the book-show view to achieve this.
Visual theme system docs: https://github.com/BookStackApp/BookStack/blob/development/dev/docs/visual-theme-system.md
Visual theme system video guide: https://www.youtube.com/watch?v=gLy_2GBse48

For this specific task, the template you'd want to override is this one:
https://github.com/BookStackApp/BookStack/blob/development/resources/views/books/show.blade.php

It'd be something along the lines of adding this:

<img src="{{ $book->getBookCover() }}" width="400">

After line 25 of the file linked above, starting with <h1 class="break-text".

@ssddanbrown commented on GitHub (Jun 27, 2022): Hi @memo-567, I responded on discord but thought I'd copy my response here and expand on it a little: You could use the visual theme system to override the book-show view to achieve this. Visual theme system docs: https://github.com/BookStackApp/BookStack/blob/development/dev/docs/visual-theme-system.md Visual theme system video guide: https://www.youtube.com/watch?v=gLy_2GBse48 For this specific task, the template you'd want to override is this one: https://github.com/BookStackApp/BookStack/blob/development/resources/views/books/show.blade.php It'd be something along the lines of adding this: ```html <img src="{{ $book->getBookCover() }}" width="400"> ``` After line 25 of the file linked above, starting with ` <h1 class="break-text"`.
Author
Owner

@memo-567 commented on GitHub (Jun 27, 2022):

I did this several times in:

themes -> mmc (this is the name of my custom theme) -> views -> books -> show.blade.php

and even

themes -> mmc -> resources -> views -> books -> show.blade.php

and always sat ownership and permissions.

But nothing takes any effect.

@memo-567 commented on GitHub (Jun 27, 2022): I did this several times in: `themes -> mmc (this is the name of my custom theme) -> views -> books -> show.blade.php` and even `themes -> mmc -> resources -> views -> books -> show.blade.php` and always sat ownership and permissions. But nothing takes any effect.
Author
Owner

@ssddanbrown commented on GitHub (Jun 27, 2022):

@memo-567 The path of your overridden view should be:

themes/mmc/books/show.blade.php
@ssddanbrown commented on GitHub (Jun 27, 2022): @memo-567 The path of your overridden view should be: ``` themes/mmc/books/show.blade.php ```
Author
Owner

@memo-567 commented on GitHub (Jun 27, 2022):

I had failed at this for two days and didn't come up with this idea 🙄

That was the reason. Thanks.

@memo-567 commented on GitHub (Jun 27, 2022): I had failed at this for two days and didn't come up with this idea 🙄 That was the reason. Thanks.
Author
Owner

@ssddanbrown commented on GitHub (Jun 27, 2022):

@memo-567 Happy to help. I've just updated the view files section of the visual theme docs with an example of paths to make this much clearer.

@ssddanbrown commented on GitHub (Jun 27, 2022): @memo-567 Happy to help. I've just updated the view files section of the visual theme docs with an example of paths to make this much clearer.
Author
Owner

@memo-567 commented on GitHub (Jun 27, 2022):

Now that really can't be misunderstood anymore 👍

@memo-567 commented on GitHub (Jun 27, 2022): Now that really can't be misunderstood anymore 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2881