How do I get an asset's filename without the extension? So if my filename is my_cool_photo.jpg
I want to return my_cool_photo
. Using {{ entry.assetsField.one.filename }}
returns the name of the file with the extension included.
1 Answer
A simple method would be to trim the extension from the filename (see this fiddle):
{{ assetsField.filename|trim('.' ~ assetsField.extension, 'right') }}