BookStack
BookStack copied to clipboard
[Feature Request] Static Button To Add Page(s)
Describe the feature you'd like I was wondering if it would be possible or difficult to add a button that says Add, Create, or a + button at the top. Giving you the ability to quickly create content...
Describe the benefits this feature would bring to BookStack users It would help to quickly create content rather than having to drill down through different books or shelves. It would be nice just to click Add pops up with a page and then you select which book and shelf you want to add the page to. Would greatly speed things up if you already have established shelves and books. To add or continue it would be nice to create books and shelves if they don't exist within this create a page option.
I also would love to have this feature. Would make my life a lot easier and faster! :)
I needed to do this. In a cram session, I needed to add two dozen chapters and two dozen pages to each chapter. Initially, the pages were to be blank (titles only), to be filled in later.
After creating a page, I had to go back to the Chapter to access the New Page button.
The solution I implemented is as follows:
- Copy /resources/views/pages/show.blade.php to /themes/
your_theme/pages/. - Near line 146, find:
{{--User Actions--}}
Add after:
@if(userCan('page-create', $page->chapter))
<a href="{{ $page->chapter->getUrl('/create-page') }}" class="icon-list-item">
<span>@icon('add')</span>
<span>Sibling Page</span>
</a>
@endif
This was taken from the /chapters/show.blade.php file, and slightly modified, because when viewing a page, the $chapter variable is not set, but $page->chapter is usable.
When viewing a page, there is now a link for adding a 'sibling page' in the same chapter.
Soon, I will do the same for Chapters - adding a sibling chapter link for the same book (without first having to view the Book page).
I needed to do this. In a cram session, I needed to add two dozen chapters and two dozen pages to each chapter. Initially, the pages were to be blank (titles only), to be filled in later.
After creating a page, I had to go back to the Chapter to access the New Page button.
The solution I implemented is as follows:
- Copy /resources/views/pages/show.blade.php to /themes/
your_theme/pages/.- Near line 146, find:
{{--User Actions--}} Add after: @if(userCan('page-create', $page->chapter)) <a href="{{ $page->chapter->getUrl('/create-page') }}" class="icon-list-item"> <span>@icon('add')</span> <span>Sibling Page</span> </a> @endifThis was taken from the /chapters/show.blade.php file, and slightly modified, because when viewing a page, the
$chaptervariable is not set, but$page->chapteris usable.When viewing a page, there is now a link for adding a 'sibling page' in the same chapter.
Soon, I will do the same for Chapters - adding a sibling chapter link for the same book (without first having to view the Book page).
Thanks for the work so far. Hopefully this can be merged into a upcoming release.