When I create a page in the panel with a name that starts with a number and is followed by a - or a character that is changed to a - (for example ‘100.1 test’):
Then the url appendix dialog says ‘101-1-test’ which is correct.
But when I click on ‘Add’, the created slug is ‘1-test’.
When I click back to the parent, I see that is has been given an index of 101. But I never meant to give it an index and I wouldn’t expect the add page dialog to do this.
Is this a bug in panel or am I doing something wrong?
Well, page slugs may not start with a number, because numbers are reserved for visibility purposes in Kirby. If you have to use a title that starts with a number, you have to make sure that the number is not part of the UID.
Isn’t it strange that the panel’s add page feature is first reporting the url appendix in the correct way and is then changing it afterwards? Feels like a bug to me…
Shouldn’t it then report an error instead, when adding the page? ‘UID’s may not start with a number’
I am not working with page visibility… In my project, I assume all pages to be ‘visible’. And I really want to avoid having every page directory having a number in front…
Actually, if the first ‘-’ would be swallowed by kirby’s slug system, we could add a - in front when the page name starts with a number and don’t want it to be used as visibility index… and it would still start out invisible
‘-101.1 test’ would generate slug: ‘101-1-test’
I will probably implement this on my side as a hook.
That gives me another error actually… and I am confused why I would need to create a new page after calling $page->move() in the first place… doesn’t it update these things internally when calling move?
Anyway, I am calling a day on this… Will try to figure out a cleaner way of dealing with this number issue another time. Thanks for helping!