spooner-web/slug-extbase

Utility to update slug fields after changing or creating Extbase objects in frontend

Fund package maintenance!
Other

Installs: 6 626

Dependents: 0

Suggesters: 0

Security: 0

Type:typo3-cms-extension

1.0.3 2021-02-02 15:45 UTC

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

  1. composer require spooner-web/slug-extbase

Via Extension Manager

  1. Download the extension from TER or inside EM
  2. 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!