This SilverStripe module allows the developer to add a field that will be converted to a slug (kebab case) when saved
For any given class that needs slugs, the extension Suilven\Sluggable\Extension\Sluggable needs added and also
the name of the field name to slug, under the key slug. The slug is stored in a field called Slug on the data object
after a write is executed.
---
Name: cricket-slugs
---
Suilven\CricketSite\Model\Club:
extensions:
- Suilven\Sluggable\Extension\Sluggable
slug: Name
Suilven\CricketSite\Model\Player:
extensions:
- Suilven\Sluggable\Extension\Sluggable
slug: DisplayNamevendor/bin/sake dev/build flush=allThen reload the browser, <your site>/admin?flush=all
Now when the above models are saved, they will be saved with a slug associated with them.
Via Composer
$ composer require suilven/sluggableAssuming the configuration above:
$club = new Suilven\CricketSite\Model\Club();
$club->Name = 'GitHub Cricket Club';
$club->write();
echo $club->SlugThe value output will be github-cricket-club
Please see CHANGELOG for more information on what has changed recently.
$ composer testPlease see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email gordon.b.anderson@gmail.com instead of using the issue tracker.
- [Gordon Anderson][link-author]
The MIT License (MIT). Please see License File for more information.

