Is it possible to hide the URL appendix field in the page creation dialog?

I would like to hide the URL appendix field in the page creation dialog.

I programmed this thing that if an editor creates a page with a title that already exists, the page just gets a randomized appendix … so I don’t need it.

This is only true for a few parent pages, though. On other parent pages, I need the URL appendix field to be there.

To clarify … the page that gets created here only contains a link and really doesn’t need a URL appendix … if fact, the field is even quite confusing for an editor (they might confuse it for the URL of the link they want to add), so I would like to hide it.

For all I know it’s currently not possible to hide any default fields (title or slug). You could hide it via CSS (don’t know if that’s possible just in the page type context), modify the dialog yourself or check out if the custom add fields plugin is still working (doesn’t look like it according to the plugin label (Custom Add Fields | Kirby CMS))

1 Like

Thank you @texnixe for the reply!

Is there any documentation on how to implement custom CSS that modifies things in the panel? I think I would give that a try…

This is the general procedure: panel | Kirby CMS

Then you have to check what you might need to modify, by inspecting the source code. But the question is if you can narrow down your target class enough, not to affect every page create dialog.

Having said that, since this slug field is required, maybe this doesn’t work after all, not sure where the validation happens. If only on the backend, should be fine, as long as you set a value in your page model.

1 Like

Thank you so much, I’ll give it a try :slight_smile:

If anyone else needs the solution:

I added a file called custom-panel.css to assets/css … the file looks like this:

/* custom css for the panel: https://getkirby.com/docs/reference/system/options/panel#custom-panel-css */

div.k-panel[data-template="werk"] div.k-slug-field,
div.k-panel[data-template="publikation"] div.k-slug-field,
div.k-panel[data-id="termine"][data-template="termine"] div.k-slug-field,
div.k-panel[data-template="gegenstand"] div.k-slug-field,
div.k-panel[data-id="/"][data-template="site"] div.k-slug-field,
div.k-panel[data-id="aktuell"][data-template="aktuell"] div.k-slug-field {
	display: none;
}

That way I hide the URL appendix in the page creation dialogs where I don’t want them, but they are still visible for the pages that need them.

in config.php I added

	'panel' => [
		'css' => 'assets/css/custom-panel.css'
	]