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
In the Panel
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.
In the content folder
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.
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.
Manual sorting
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:
Date-based sorting
For blogs, events or anything else that is date-based, the date can be prepended as the sorting number, also followed by an underscore:
Alphabetical sorting
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.