Skip to content
Kirby 6 is here! Learn more

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.

Unsaved changes

When you edit pages, files or user accounts in the Panel, you will see our "unsaved changes" form controls show up on the top of the view that allow you to either save or discard these changes.

The labels of fields with unsaved changes are highlighted, so you can see at a glance what you've changed before you save.

Get more details about the changes for the current page, file or user, by accessing the info dropdown next to the form controls:

Changes dialog

All changes by everyone in the team - not just the current editor - are listed in the Changes dialog (accessible via the “Changes” menu item in the sidebar) and grouped by type (page, user, file). Everyone in the team can directly use the dialog to jump to changes by other team members and preview them directly on the fly, even while someone else is still actively working on them.

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 make any new changes within some time, the page will be unlocked again. 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.

Live editor

The preview button at the top of a page opens the live editor: the rendered page on the left, the page's form with all its tabs on the right. The preview always shows your changed version and reloads automatically as you type.

The preview view has four modes:

  • Live editor: the changed version next to the form
  • Compare versions: the latest and the changed version side by side, optionally with synced scroll positions
  • Latest version: only the latest published version
  • Changed version: only the changed version

Links in the preview work like on your site. When you follow a link to another page, the form switches to that page as well. Links to other domains and into the Panel open in a new tab, and a click on the page title in the header lets you jump to any other page. To look at one page while editing another, pin the preview: the preview and the form then navigate independently until you unpin it.

To use a second screen, open the preview in its own browser tab with the button in the header and drag the tab to its own window. The form then takes up the full width of the main window. The preview still reloads when you change content in the form, navigating in either window takes the other one along, and pinning works there as well. Close the tab to bring the preview back to the main window.

Buttons in the header show your page in different viewport widths. You can define your own sizes with the panel.preview.sizes option.

Page states

Kirby's page states give you full control over your publishing workflow. This 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

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

To

  • /content/projects/my-project-draft

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:

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

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

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.

  • only-access-via-url

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.

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.