first Modifier

Returns the first X characters of a string, where X is any positive integer, or the first item in an array.

title: 2015 Year Books Photos
array:
- Sonic
- Knuckles
- Tails
{{ title | first(4) }}
{{ array | first }}
{{ Statamic::modify($title)->first(4) }}
{{ Statamic::modify($array)->first() }}
2015
Sonic
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →