Add View Tags Button to Home Page #4219

Closed
opened 2026-02-05 08:16:47 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @aswgxf on GitHub (Sep 18, 2023).

Describe the feature you'd like

When the default Home Page is set to either Shelves or Books, I would like to see the "View Tags" button in the actions menu. It shows up when going directly to the Shelves or Books pages, so I think it should also be present on the home page if it has been set to either of those views.

Describe the benefits this would bring to existing BookStack users

It would provide greater consistency between the pages. Without this, it is less clear how to access the list of tags, since I didn't consider going to the "real" shelves page as opposed to the shelves version of the home page.

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

No

Have you searched for an existing open/closed issue?

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

How long have you been using BookStack?

3 months to 1 year

Additional context

Home page actions when set to Shelves view
image

Shelves page actions
image

Originally created by @aswgxf on GitHub (Sep 18, 2023). ### Describe the feature you'd like When the default Home Page is set to either Shelves or Books, I would like to see the "View Tags" button in the actions menu. It shows up when going directly to the Shelves or Books pages, so I think it should also be present on the home page if it has been set to either of those views. ### Describe the benefits this would bring to existing BookStack users It would provide greater consistency between the pages. Without this, it is less clear how to access the list of tags, since I didn't consider going to the "real" shelves page as opposed to the shelves version of the home page. ### Can the goal of this request already be achieved via other means? No ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundamental request ### How long have you been using BookStack? 3 months to 1 year ### Additional context Home page actions when set to Shelves view ![image](https://github.com/BookStackApp/BookStack/assets/14831028/a917a163-0b0e-4dea-b2d0-07fbbe98a36a) Shelves page actions ![image](https://github.com/BookStackApp/BookStack/assets/14831028/12371df8-aba6-46aa-ba6b-ab2293f9f9b0)
OVERLORD added the 🔨 Feature Request label 2026-02-05 08:16:47 +03:00
Author
Owner

@Man-in-Black commented on GitHub (Sep 18, 2023):

You could achieve this with the visual theme system I think.
I've put the tags up to the header besides the shelves, like here along with some other links:
image

You can start here: https://www.bookstackapp.com/docs/admin/visual-customisation/
and then add the following code before the shelve-link:

<a href="/tags">@icon('tag'){{ trans('entities.tags') }}</a>
<a href="/favourites">@icon('star_white'){{ trans('common.favourite') }}</a>

@if(userCanOnAny('view', \BookStack\Entities\Models\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
  <a href="{{ url('/shelves') }}" data-shortcut="shelves_view">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
@endif
@Man-in-Black commented on GitHub (Sep 18, 2023): You could achieve this with the visual theme system I think. I've put the tags up to the header besides the shelves, like here along with some other links: ![image](https://github.com/BookStackApp/BookStack/assets/9048534/40b875fe-33d7-47e6-998e-d45c67cfb8ae) You can start here: https://www.bookstackapp.com/docs/admin/visual-customisation/ and then add the following code before the shelve-link: ~~~ <a href="/tags">@icon('tag'){{ trans('entities.tags') }}</a> <a href="/favourites">@icon('star_white'){{ trans('common.favourite') }}</a> @if(userCanOnAny('view', \BookStack\Entities\Models\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own')) <a href="{{ url('/shelves') }}" data-shortcut="shelves_view">@icon('bookshelf'){{ trans('entities.shelves') }}</a> @endif ~~~
Author
Owner

@SirTwinkleberry commented on GitHub (Sep 19, 2023):

You could achieve this with the visual theme system I think. I've put the tags up to the header besides the shelves, like here along with some other links: image

You can start here: https://www.bookstackapp.com/docs/admin/visual-customisation/ and then add the following code before the shelve-link:

<a href="/tags">@icon('tag'){{ trans('entities.tags') }}</a>
<a href="/favourites">@icon('star_white'){{ trans('common.favourite') }}</a>

@if(userCanOnAny('view', \BookStack\Entities\Models\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
  <a href="{{ url('/shelves') }}" data-shortcut="shelves_view">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
@endif

Thanks for the hack. If someone wants the full process on how to implement it (I'm a bit slow and it took me a while to make it work myself):

Follow the directions on how to implement a custom visual theme (text, video), i.e.

  1. create a directory for your custom theme (e.g. custom) in the themes directory located @ BookStack root
  2. set variable APP_THEME of the .env file to the name of your custom theme (e.g. APP_THEME=custom)
  3. create a directory named common in your custom theme directory
  4. copy the file located @ BookStack/resources/views/common/header.blade.php to the newly created common directory
  5. modify its contents to add the desired links to the header ribbon, such as what suggested @Man-in-Black

I've noted that @icon('star_white') did not work for me, but @icon('star') did. Also, I changed {{ trans('common.favourite') }} into {{ trans('entities.my_favourites') }} and removed the link to Books as a personal preference. Finally, because I don't want guests (with no favorites) to see that link, I've set the "My Favourites" link within an @if(signedInUser()) block.

Attached, the header.blade.php file with the modified header ribbon for the custom theme.
header.blade.php.zip

image

@SirTwinkleberry commented on GitHub (Sep 19, 2023): > You could achieve this with the visual theme system I think. I've put the tags up to the header besides the shelves, like here along with some other links: ![image](https://user-images.githubusercontent.com/9048534/268733660-40b875fe-33d7-47e6-998e-d45c67cfb8ae.png) > > You can start here: https://www.bookstackapp.com/docs/admin/visual-customisation/ and then add the following code before the shelve-link: > > ``` > <a href="/tags">@icon('tag'){{ trans('entities.tags') }}</a> > <a href="/favourites">@icon('star_white'){{ trans('common.favourite') }}</a> > > @if(userCanOnAny('view', \BookStack\Entities\Models\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own')) > <a href="{{ url('/shelves') }}" data-shortcut="shelves_view">@icon('bookshelf'){{ trans('entities.shelves') }}</a> > @endif > ``` Thanks for the hack. If someone wants the full process on how to implement it (I'm a bit slow and it took me a while to make it work myself): Follow the directions on how to implement a custom visual theme ([text](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/visual-theme-system.md), [video](https://www.youtube.com/watch?v=gLy_2GBse48)), i.e. 1. create a directory for your custom theme (e.g. `custom`) in the `themes` directory located @ BookStack root 2. set variable `APP_THEME` of the `.env` file to the name of your custom theme (e.g. `APP_THEME=custom`) 3. create a directory named `common` in your custom theme directory 4. copy the file located @ `BookStack/resources/views/common/header.blade.php` to the newly created `common` directory 5. modify its contents to add the desired links to the header ribbon, such as what suggested @Man-in-Black I've noted that `@icon('star_white')` did not work for me, but `@icon('star')` did. Also, I changed `{{ trans('common.favourite') }}` into `{{ trans('entities.my_favourites') }}` and removed the link to `Books` as a personal preference. Finally, because I don't want guests (with no favorites) to see that link, I've set the "My Favourites" link within an `@if(signedInUser())` block. Attached, the `header.blade.php` file with the modified header ribbon for the custom theme. [header.blade.php.zip](https://github.com/BookStackApp/BookStack/files/12665538/header.blade.php.zip) ![image](https://github.com/BookStackApp/BookStack/assets/30357667/5c1221ea-03c3-4905-99cb-8f104f242f4c)
Author
Owner

@ssddanbrown commented on GitHub (Sep 19, 2023):

@Man-in-Black @Timothy-Anders0n Based upon your comments, and others I've seen in the past, I've opened #4564 with the intent to provide an empty template view file for adding links to via the visual theme system, so you don't have to override and maintain the whole header bar.


@aswgxf Thanks for the request, and I do agree that the tags view has a higher chance of being missed if books/shelves are set as the homepage, due to less frequent visiting of those specific views. Makes sense to also show that tags button when they're used as the homepage option, will target that for the next feature release.

I won't add to the default homepage though since it'd set the actions out of balance, and there's a higher chance of the normal books/shelves views being used anyway. Plus I have some other ideas to bring tags more into the foreground in the future.

@ssddanbrown commented on GitHub (Sep 19, 2023): @Man-in-Black @Timothy-Anders0n Based upon your comments, and others I've seen in the past, I've opened #4564 with the intent to provide an empty template view file for adding links to via the visual theme system, so you don't have to override and maintain the whole header bar. --- @aswgxf Thanks for the request, and I do agree that the tags view has a higher chance of being missed if books/shelves are set as the homepage, due to less frequent visiting of those specific views. Makes sense to also show that tags button when they're used as the homepage option, will target that for the next feature release. I won't add to the default homepage though since it'd set the actions out of balance, and there's a higher chance of the normal books/shelves views being used anyway. Plus I have some other ideas to bring tags more into the foreground in the future.
Author
Owner

@ssddanbrown commented on GitHub (Sep 24, 2023):

Button now added in c3b4128a38 for books/shelves home views, to be part of next feature release.

@ssddanbrown commented on GitHub (Sep 24, 2023): Button now added in c3b4128a38e2c07e87492c33ead2186bdf531904 for books/shelves home views, to be part of next feature release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4219