dariuszp / silverstripe-betterslug
Better slug transliterator for Silverstripe with accent folding
Installs: 569
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 2
Open Issues: 0
Type:silverstripe-module
Requires
- php: >=5.3.2
This package is not auto-updated.
Last update: 2024-11-19 05:14:24 UTC
README
Slug generator with accent folding for Silverstripe CMS
This module will provide better text to slug translation for silverstripe by replacing very basic transliterator with cocur/slugify module: https://github.com/cocur/slugify
Installation:
composer require dariuszp/silverstripe-betterslug
// or if you have .phar package
./composer.phar require dariuszp/silverstripe-betterslug
Usage
When you create page with title like this:
Τάρτες ατομικές με γέμιση πορτοκαλένιας κρέμας και γλυκό πορτοκάλι
It will be translated to:
tartes-atomikes-me-gemisi-portokalenias-kremas-kai-gliko-portokali
Istead of page-41 like before.
In case some characters are not handled, you can further configure module by add your own translation rules. For example:
_config.yml
BetterSlug:
rulesets:
symbols:
active: true
map:
☂: ubrella
☁: cloud
This will turn:
When you see dark ☁, bring an ☂!
Into:
when-you-see-dark-cloud-bring-an-ubrella