Closed angrybrad closed 7 years ago
Posted by Jason McCallister (themccallister@gmail.com) on 2015/03/20 17:34:31 +0000
Thanks Brandon!
Posted by Brandon Kelly (brandon@pixelandtonic.com) on 2015/03/06 03:54:45 +0000
Just edited the idea to remove the 'slugify' half of the request. FFR please keep each idea limited to one FR.
Posted by Lindsey DiLoreto (lindsey@doublesecretagency.com) on 2015/03/11 04:48:18 +0000
This is half-done... As of Craft 2.4, there is now a "kebab" filter (basically a slug filter):
http://buildwithcraft.com/docs/templating/filters#kebab
{{ myVar | kebab }}
Posted by Lindsey DiLoreto (lindsey@doublesecretagency.com) on 2015/03/11 04:48:18 +0000
Sounds awesome, this would be great!
{{ myVar | slug }}
{{ myVar | camelCase }}
Craft 2.5 added a ‘camel’ Twig filter (as well as ‘pascal’ and ‘snake’).
Craft comes with its own set of Twig filters that are listed here:
http://buildwithcraft.com/docs/templating/filters
It would be nice, since everything in Craft is camel cased, for Craft to add a custom camelcase filter.
The only real solution right now is to do something like this:
{{ variable | title | replace(' ', '') | lcfirst }}
Which is using a custom Craft Twig filter (lcfirst).