Closed mrflix closed 4 months ago
Interestingly enough I did attempt something very similar recently. Unfortunately I did not manage to hide the slug field in the page creation dialog. Somehow that field seems to be hardcoded, you can't even change the type to hidden
. I remember I found multiple questions about that in the Discord and Forums.
But yeah, if that worked it would be easy to implement it exactly how you described.
In v4 it's super easy to hide the dialog in the creation dialog 😍
You can't hide it in the title editing dialog but disabling the field does the job that you won't run into problems here:
Do you mind sharing the code you used to inject the uuid?
Oh wait, no: I did indeed hide the field using CSS 😬
[data-id="default"] .k-dialog-body .k-field-name-slug {
display: none;
}
I'm afraid I gave up after the slug field disappointment 😬
What I planned was the following: since the UUID is generated after this dialog I wanted to generate a UUID as the value (or default value) of the (invisible) slug field. Then I would have been able to overwrite the UUID method in the page model.
FYI: I just pre-released Kirby Modules 2.7.1 with this feature.
A client want's to get rid of the slugs input field when creating a module. I think they have a point because as long as we don't use them for in-page hash-navigation (studio-walz.com/#our-team), they're never user-facing. The slug could as well be an auto-generated UUID.
I'm thinking about how to best approach this. I guess I'll need Kirby 4 and I need to hide the slug input via
create
in the page blueprint. And I need to disable changing the slug:Next I'd have to hook into the page creation cycle to set the slug to a generated UUID.
@medienbaecker did you ever attempt this? Do you think it's feasible?