Closed derekwelton closed 9 months ago
Did you mean something like that?
Did you mean something like that?
Yes, exactly like that. How is that done? I've looked through the settings, is this in the config file to enable?
no, I've done it via the visual theme system by modifying some of the php files of the application. I can write a little guide tomorrow.
Alright...
For the pages to show the tags (and on top if it is a template or not) you need to edit the pages/parts/list-item.blade.php
file in your theme folder.
I've changed the file from
@component('entities.list-item-basic', ['entity' => $page])
<div class="entity-item-snippet">
<p class="text-muted break-text">{{ $page->getExcerpt() }}</p>
</div>
@endcomponent
to
@component('entities.list-item-basic', ['entity' => $page])
<div class="entity-item-snippet">
<p class="text-muted break-text">
<!-- added for template marking -->
@if($page->template)
@icon('template')
@endif
<!-- end template marking -->
{{ $page->getExcerpt() }}
<!-- show tags -->
@if($page->tags->count() > 0)
@foreach($page->tags as $tag)
@include('entities.tag-page-list', ['tag' => $tag])
@endforeach
@endif
<!-- end show tags -->
</p>
</div>
@endcomponent
so you get the view as shown above and on top templates are marked with a template symbol like this:
Alright... For the pages to show the tags (and on top if it is a template or not) you need to edit the
pages/parts/list-item.blade.php
file in your theme folder. I've changed the file from@component('entities.list-item-basic', ['entity' => $page]) <div class="entity-item-snippet"> <p class="text-muted break-text">{{ $page->getExcerpt() }}</p> </div> @endcomponent
to
@component('entities.list-item-basic', ['entity' => $page]) <div class="entity-item-snippet"> <p class="text-muted break-text"> <!-- added for template marking --> @if($page->template) @icon('template') @endif <!-- end template marking --> {{ $page->getExcerpt() }} <!-- show tags --> @if($page->tags->count() > 0) @foreach($page->tags as $tag) @include('entities.tag-page-list', ['tag' => $tag]) @endforeach @endif <!-- end show tags --> </p> </div> @endcomponent
so you get the view as shown above and on top templates are marked with a template symbol like this:
Excellent example. Thank you for taking the time to share it. Works as expected. Thanks again!
I'm happy if I could help you with this little tweak ;-)
Thanks @Man-in-Black for helping provide a workaround here. Since this has been solved via a workaround, and since I'm not keen to expand tags into this view, I'm going to close this off. There's #4536 which would additionally help the original request via the alternative option of searching for content without specific tags.
Hi,
I'm running v24.02.2, but your workaround was not working, I had the following error in laravel.log : [previous exception] [object] (InvalidArgumentException(code: 0): View [entities.tag-page-list] not found. at /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:137)
I updated it to the following and it now works :
@component('entities.list-item-basic', ['entity' => $page])
<div class="entity-item-snippet">
<p class="text-muted break-text">
<!-- added for template marking -->
@if($page->template)
@icon('template')
@endif
<!-- end template marking -->
{{ $page->getExcerpt() }}
<!-- show tags -->
@if($page->tags->count() > 0)
<div class="entity-item-tags mt-xs">
@include('entities.tag-list', ['entity' => $page, 'linked' => false ])
</div>
@endif
<!-- end show tags -->
</p>
</div>
@endcomponent
This helped me solve an issue, thanks! I'm curious: is it possible to extend this to display a clickable tagcloud/sorted list of unique tags above the list of pages in a book?
Describe the feature you'd like
Currently in the Search Results, It shows the Tags associated with that page like below:
But I wish we could see the tags when we have a "Book" view or Chapter opened that showed the tags. Currently it does not:
Describe the benefits this would bring to existing BookStack users
I believe having tags more available in other views besides Search and viewing the page itself gives the users a better idea on what each page contains without having to go into each page. One method we use tags for is to tag pages that need to be reviewed. Having the ability to go into each Book and see from a glance which pages/chapters have the "need review" tag.
Another approach to solving my issue is having the ability to filter pages that do not have a specific tag as well.
Can the goal of this request already be achieved via other means?
Since the search results view already has this feature implemented, I assume it wouldn't take too much effort to implement this.
Have you searched for an existing open/closed issue?
How long have you been using BookStack?
Over 5 years
Additional context
No response