Custom Page UIDs


two questions i couldn’t solve by searching the forum:

How can you change the page UID when changing the page title? I tried with a page.changeTitle:after hook and $page->changeSlug() but how to update the panel view after the change and not produce a “page not found” error?

Second is bigger but also related to having an accurate folder structure by creating content via the panel:
Is there any way to append additional information to the (sub)page’s folder name, and keep it throughout the publishing workflow? Dream would be (nevermind the status):

  • Ymd_pagetemplatename_pagetitle

Thank you a lot!

First question: This will be better in Kirby 3.5, with a changeTitle dialog that allows you to change the slug at the same time, you can already check out the pre-release here:

Will be release on Dec, 15th.

Adding additional information is possible via a page model where you overwriting the create() method.

Note that a prepended date (with underscore) automatically changes the page status and will not become part of the URL.