Utility to update slug fields after changing or creating Extbase objects in frontend
What does it do?
In general, the slug field is updated on every change in backend or via DataHandler.
But using forms in frontend to change Extbase models doesn't have an effect on the slug field.
This extensions provides an interface to use in your Extbase model.
With a proper TCA configuration it automatically updates the slug field if one of the configured table fields was changed.
composer require spooner-web/slug-extbase
Via Extension Manager
- Download the extension from TER or inside EM
- Activate the package
Add the provided interface
\SpoonerWeb\SlugExtbase\SlugEntityInterface to your Extbase model, e.g.
class MyModel extends TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements \SpoonerWeb\SlugExtbase\SlugEntityInterface
Okay, you need a slug field in database and the TCA configuration for it as well.
Whenever you create or update an Extbase model via a frontend form, the magic happens and the slug field will be updated like you configured it.
Thanks to 12bis3 for the ideas to use interfaces and for the automatic slug update!