Editing & publishing workflow
Pages can have different states in Kirby, allowing you to control who has access to content, to filter by status, or to implement a full publishing workflow from drafts to published in the Panel.
Content locking
Kirby automatically locks pages that are currently being edited by another user in the Panel, making working in teams a lot safer. If you open a page that is edited by another user, you are informed about the editing user and cannot overwrite their changes.
If the editing user doesn't save their changes within 2 minutes, you can unlock the page. If you do so, the editing user is informed that their changes have been overwritten and can then download them to edit the unsaved changes manually.
You can deactivate content locking via the content.locking
config option in your site/config/config.php
.
Unsaved changes
When you edit pages, files or user accounts in the Panel, you will see an "unsaved changes" icon in the topbar. This overview of unsaved changes makes it a lot easier to keep track of content that is still work-in-progress.
Page states
Kirby's page states give you full control over your publishing workflow. They allows you to define access to content, to filter content by status criteria and much more.
Let's look at what the three states mean again before we go into details:
Page state | Description |
---|---|
Draft | Draft pages live in the _drafts folder of their parent page. Only logged-in users or users who received the secret draft link can access draft pages. |
Unlisted | Unlisted pages are published pages without a prepended number. They are accessible via their URL but they are not sorted based on their folder number. |
Listed | Listed pages are published pages with a prepended number by which they can be sorted. You can use one of three sorting schemes for these numbers. |
In your blueprints for the Panel, you can change the naming for these states or limit the available states on a per template basis, for example, to implement a draft/in-review/published workflow.
Publishing drafts
To publish a draft in the Panel, click on the "Draft" button with the red status icon in the toolbar or go to "Settings" > "Change status".
You can only publish a draft in the Panel if all required fields are filled in and all validations have passed.
To publish a draft manually in your content folder, drag it from the _drafts
folder to the parent directory:
From
To
This will make the page unlisted
. You can make it listed
and apply sorting by prepending a number. Optionally, you can then delete the _drafts
folder if it's no longer needed or just leave it in place.
Drafts in your templates
Drafts are not included in $page->children()
collections. If you have to access them in your templates, you can use the $page->drafts()
method, or if you want to get both children and drafts, use $page->childrenAndDrafts()
.
Listed pages
Listed pages are public pages with a sorting number in their content folder. You can choose between three different numbering schemes, depending on what is most useful for the type of page.
For a basic menu, a list of projects or any other non-alphabetical list you often need manual sorting. Manual sorting is applied by prepending a number followed by an underscore:
For blogs, events or anything else that is date-based, the date can be prepended as the sorting number, also followed by an underscore:
To sort pages alphabetically, 0 is prepended as the sorting number in the file system:
Unlisted pages
Pages without a sorting number are unlisted pages. Unlisted pages are still accessible by anyone who knows the URL to the page. Unlisted pages are useful if you want to exclude them from menus or lists. A typical example for an unlisted page would be the error page or maybe a new project that still needs to be reviewed by the client via URL, but not yet listed.
If you publish pages that are only intended as data containers but should not be accessible via their URL, you can use Kirby's router to prevent access to such pages.
Since 4.0.0
Moving pages
Use the move dialog to pick a new parent page for your page. Kirby will make sure that the page can only be moved if the page type is allowed in the new parent.
To do so, select "Settings" > "Move page". In the move dialog, select the parent you want to move the page to. Unavailable parents are greyed out. When done, confirm with the "Move" button. By default, Kirby adds "copy" to title and slug.