The folders get names like “20170216-fancy-event” although url key is still made from the title. I get this is very deliberate so that folders get sorted by date.
If i wanted url-keys to be the same as foldernames the best way is to use page update hook and rewrite url key eachtime?
I’m not sure I get it. What do you want to update, the field called URL-Key? You can only use this field in a multi-language installation and only for the non-default languages.
Oh so this is more complicated than i thought. I had no idea you can use url keys only on translated content.
I want to have url
http://mysite.com/events/20170713-funny-event
I guess its whats called wordpress urls in docs. Funny thing is the folders have right name but kirby is clever removing date. So i have to actualy change the title to 20170713 Funny Event to make url on default language lol.
Its first time kirby seems strange. So the hack to do this would be to use urlkeys so make separate language which i dont use :D.
Or use title as “url” field and then make differend field to be title…
Problem is you can’t use titles that start with a number in Kirby because of the way visibility works. A title like “20170213 Fancy event” will be converted to a folder name “20170213-fancy-event”, where the number will not appear in the URL because it will be regarded as sorting number.
The problem I see with this approach is that the URL of the event changes with each page update. Is that intended use? So if you post a link to this page, the link will be gone the next time the page is updated.
Oh, I’m very sorry, forget about it. I totally overlooked that you are using the date in the page, my bad, I thought you were appending the current date