Is it possible to do something like this
{if imagefield == ".gif"}
{imagefield}
{elseif}
{imagefield:midsize}
{/if}As I want animated gifs on site but if I load in the reduced size version it loses it animated capabilities
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
June 23, 2014 11:49am
Subscribe [2]#1 / Jun 23, 2014 11:49am
Is it possible to do something like this
{if imagefield == ".gif"}
{imagefield}
{elseif}
{imagefield:midsize}
{/if}As I want animated gifs on site but if I load in the reduced size version it loses it animated capabilities
#2 / Jul 18, 2014 12:31pm
I don’t use file field for images ever but documentation doesnt have any mime type variables which is what you’d need. All I could find is if viewable_image.
So you’ll have to improvise:
- get Channel Images and use its {image:mimetype}
- use PHP to deconstruct the file name and check for what you need
- use EE regular expressions with the matches operator (2.9+ only, I think?)