BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

[Feature Request] Static Button To Add Page(s)

Open athornfam2 opened this issue 4 years ago • 3 comments

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.

athornfam2 avatar Aug 15 '21 18:08 athornfam2

I also would love to have this feature. Would make my life a lot easier and faster! :)

thejezzi avatar Aug 23 '22 12:08 thejezzi

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:

  1. Copy /resources/views/pages/show.blade.php to /themes/your_theme/pages/.
  2. 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).

bhsmither avatar Sep 21 '22 02:09 bhsmither

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:

  1. Copy /resources/views/pages/show.blade.php to /themes/your_theme/pages/.
  2. 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).

Thanks for the work so far. Hopefully this can be merged into a upcoming release.

athornfam2 avatar Sep 21 '22 13:09 athornfam2