]> BookStack Code Mirror - website/blob - content/docs/user/page-templates.md
Final post release time
[website] / content / docs / user / page-templates.md
1 +++
2 title = "Page Templates"
3 date = "2022-11-24"
4 type = "user-doc"
5 slug = "page-templates"
6 +++
7
8 Within BookStack you can mark a page as a template so that its content
9 can easily be reused when editing and creating pages.
10 This can be super useful when you need to create many pages following
11 a similar format.
12
13 {{<toc>}}
14
15 ### Creating a Page Template
16
17 A page template in BookStack is simply a normal page that has been marked as a template.
18 Start by creating/editing the page you want to use as a template.
19 Within the editor sidebar you should see a templates tab.
20 Within this tab you should find a "Page is a template" checkbox.
21 Simply check that option and save the page to make the page become a template. 
22 If you don't see that checkbox, you likely lack the "Manage page templates" role system permission.
23
24 ![Page edit view showing the templates tab and mentioned checkbox](/images/docs/user/template_checkbox.png)
25
26 Note: Visibility of page templates are controlled via visibility of the page itself. If a user lacks permission to view the page marked as a template, it will not show as an available template for them.
27
28 ### Using Page Templates
29
30 Page templates can be accessed when creating or editing a page.
31 Within the editor sidebar you should see a templates tab.
32 If you have templates available they will be listed in this area.
33 A search bar will also show for easy searching of templates.
34
35 There are multiple ways to add a template into a page:
36
37 - Select the template box itself to replace the editor content with contents of the template.
38 - Select the up arrow of the template box to prepend its contents to the editor.
39 - Select the down arrow of the template box to append its contents to the editor.
40 - Drag the template box into the editor to insert its contents into the dragged location.
41
42 ![Dragging a template into the page editor](/images/docs/user/template_dragging.png)
43
44 Keep in mind that using a template simply copies its content at time-of-use, it is not
45 a "live" connection to the template page, and updating the template page won't affect pages that have previously used it as a template.
46
47 ### Default Page Templates
48
49 If you'd like to always start a new page with a specific template, this can be configured at a per-book level using the
50 "Default Page Template" option when editing a book:
51
52 ![Dragging a template into the page editor](/images/docs/user/templates-default-book.png)
53
54 With this option set, the selected template will be used to pre-fill the contents of any new page created within that book.
55 Like with other template usages, access to the template will be controlled by permissions.
56 If a user creates a page with the book, but does not have access to view the template page, it will not be used to pre-fill the contents of the new page.