Skip to content

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

Since 3.2.0

Kirby automatically locks pages that are currently being edited by another user, 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.

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 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.

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".

In the content folder

To publish a draft manually in your content folder, drag it from the _drafts folder to the parent directory:

From

  • /content/projects/_drafts/my-project-draft

To

  • /content/projects/my-project-draft

This will make the page listed. You can 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:

  • 1_best-project
  • 2_okayish-project
  • 3_dont-look-at-this-one

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:

  • 20121212_hello-world
  • 20181212_really-bad-at-regular-blogging

Alphabetical sorting

To sort pages alphabetically, 0 is prepended as the sorting number in the file system:

  • 0_alpaca
  • 0_bear
  • 0_camel

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.

  • im-only-accessible-via-url