Hi!
I would like to use unique id strings for pages. My question is whether every autogenerated $page->uid()
is unique?
Thank you in advance!
Hi!
I would like to use unique id strings for pages. My question is whether every autogenerated $page->uid()
is unique?
Thank you in advance!
No, the slug is only unique for each child of a given parent, while subpages of different parents can have the same slug/uid.
e.g.
notes/my-awesome-subpage
blog/my-awesome-subpage
So the uid/slug of both of these subpages would be my-awesome-subpage
.
Immutable IDs are planned (Immutable IDs for pages ยท Kirby Feedback).
For now you can use this plugin to generate Unique IDs: GitHub - bnomei/kirby3-autoid: Automatic unique ID for Pages, Files and Structures including performant helpers to retrieve them. Bonus: Tiny-URL.
Thank you for your replies, very helpful!