Open Tofandel opened 8 months ago
I want to hide the language in the permalink of the admin interface only for the default language (which I think is a common use case)
So I provide something like this according to https://twillcms.com/docs/modules/controllers.html
protected function formData($request): array { return parent::formData($request) + [ 'localizedCustomPermalink' => [ config('app.locale') => route('partners.details', Partner::find($request->route('partner'))) ] ]; }
Which shows correctly here
But shows wrong information while editing
And prevents the configured custom permalink from updating on the page once it's been saved
It seems a different approach is needed for this to work, I'm thinking something like:
protected function formData($request): array { return parent::formData($request) + [ 'localizedCustomPermalink' => [ config('app.locale') => route('partners.details', '{slug}') ] ]; }
Maybe provided outside of formData as well that we could correctly use and replace in both places
formData
Description
I want to hide the language in the permalink of the admin interface only for the default language (which I think is a common use case)
So I provide something like this according to https://twillcms.com/docs/modules/controllers.html
Which shows correctly here
But shows wrong information while editing
And prevents the configured custom permalink from updating on the page once it's been saved
It seems a different approach is needed for this to work, I'm thinking something like:
Maybe provided outside of
formData
as well that we could correctly use and replace in both places