spooner-web / slug-extbase
Utility to update slug fields after changing or creating Extbase objects in frontend
Fund package maintenance!
Other
Requires
- php: ^7.2
- typo3/cms-core: ^9.5 || ^10.4
- typo3/cms-extbase: ^9.5 || ^10.4
This package is auto-updated.
Last update: 2024-10-14 15:59:05 UTC
README
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.
Installation
Via composer
composer require spooner-web/slug-extbase
Via Extension Manager
- Download the extension from TER or inside EM
- Activate the package
Usage
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
That's it.
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.
Kudos
Thanks to 12bis3 for the ideas to use interfaces and for the automatic slug update!