-
-
Save brookinsconsulting/337265c55e4909119580fd2834e655a8 to your computer and use it in GitHub Desktop.
ezpublishplatform and ezplatform SlugConverter class to transform all urlalias(es) into lowecase (ezp v3 style)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* File containing the BcLowerCaseUnderscoreUrlAliasSlugConverter class part of the BcLowerCaseUrlAliasBundle package. | |
* | |
* @copyright Copyright (C) Brookins Consulting. All rights reserved. | |
* @license For full copyright and license information view LICENSE and COPYRIGHT.md file distributed with this source code. | |
* @version //autogentag// | |
* @package BcLowerCaseUrlAliasBundle | |
*/ | |
/** | |
* Source: http://share.ez.no/forums/ez-platform/urlalias-lowercase-transform-equivalent | |
* | |
* Instrucctions: change the class from parameters | |
* | |
* parameters: | |
* ezpublish.persistence.slug_converter.class: BrookinsConsulting\BcLowerCaseUrlAliasBundle\Core\Persistence\Legacy\Content\UrlAlias\BcLowerCaseUnderscoreUrlAliasSlugConverter | |
* | |
*/ | |
namespace BrookinsConsulting\BcLowerCaseUrlAliasBundle\Core\Persistence\Legacy\Content\UrlAlias; | |
use eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\SlugConverter; | |
use eZ\Publish\Core\Persistence\TransformationProcessor; | |
class BcLowerCaseUnderscoreUrlAliasSlugConverter extends SlugConverter { | |
/** | |
* Creates a new URL slug converter. | |
* | |
* @param \eZ\Publish\Core\Persistence\TransformationProcessor $transformationProcessor | |
* @param array $configuration | |
*/ | |
public function __construct(TransformationProcessor $transformationProcessor, array $configuration = array()) | |
{ | |
$this->configuration['transformationGroups']['urlalias']['commands'] = | |
array_merge($this->configuration['transformationGroups']['urlalias']['commands'], array( | |
'ascii_lowercase', | |
'cyrillic_lowercase', | |
'greek_lowercase', | |
'latin1_lowercase', | |
'latin-exta_lowercase', | |
'latin_lowercase', | |
) | |
); | |
$this->configuration['wordSeparatorName'] = 'underscore'; | |
parent::__construct($transformationProcessor, $configuration); | |
} | |
} | |
?> |
Hello eZ Publish Platform Community!
We have completed many significant improvements to the above static php gist code and packaged the entire solution.
This Gist is now deprecated. We strongly recommend you download and use our new feature complete (usable out of the box) bundle:
- https://github.com/brookinsconsulting/BcLowerCaseUrlAlias
- https://packagist.org/packages/brookinsconsulting/bclowercaseurlaliasbundle
We hope these improvements help other users!
Cheers,
Brookins Consulting
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello eZ Publish Platform Community!
We have made a slight modifications to the original version of this code contributed by Vincent Guyard to fix a documentation typo which for some users could cause usage confusion.
We hope to soon integrate this code into a stand alone bundle which we hope will increase it's usability out of the box.
Cheers,
Brookins Consulting