-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add the contao.slugify service #569
Conversation
However, why are we slugifying at all? All browsers can handle UTF-8 URLs meanwhile, so we might as well just leave |
The PR requires the following code to be added in # Slugify
cocur_slugify:
regexp: "#([^A-Za-z0-9/.]|-)+#" This will add |
f068e0e
to
54f7e1c
Compare
$strName = preg_replace('/[^A-Za-z0-9._-]/', '', $strName); | ||
$strName = basename($strName); | ||
$strName = \System::getContainer()->get('contao.slugify')->slugify($objTheme->name); | ||
$strName = str_replace(array('-/', '/-', '.-', '.'), array('', '', '-', ''), $strName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nasty. We need the service to be aware of Config::get('folderUrl')
, which means we first have to move the setting into the application configuration.
I have updated the PR so it initializes the Slugify regex depending on the The initial problem is the Slugify service not providing a |
The ruleset stuff feels wrong. We're always activating rulesets, but they are never removed? |
The ruleset stuff is wrong. See cocur/slugify#133 😄 |
I think this PR is outdated or am I wrong? |
You are wrong. Our changes have been merged but there has not been a release since then. As soon as a new version is released, I will complete the PR. |
c8f2f0d
to
09536d6
Compare
295a408
to
5554e03
Compare
37c46b2
to
b659d4d
Compare
cf5c60f
to
fbee6c7
Compare
To be honest, I think it depends. It's something that should be a setting of a root page. If you think in German, somebody might want to have URI's like |
If |
I don't think that's currently possible, I guess the Symfony CMF-Router can solve this, but as we know that's not a simple task. |
I'm closing this in favor of #1016. |
TODO
Utf8::toAscii()
calls where applicable@contao/developers /cc