By default, the Panel will try to lock a page if a user makes unsaved changes to it to prevent another user to make changes at the same time.
Kirby creates a
.lock file in the directory of the content file, retrieved via
Page::contentFileDirectory(). However, your virtual page might not support any content file directory. Let's see how to deal with these cases.
In many cases of virtual pages, content locking might not be desired. If you want to disable content locking for your virtual page, add a
lock() method to your page model which returns
To support content locking for your virtual page, Kirby expects a
lock() method in your page model. The method needs to return an object of a custom class that handles the various content locking features: