ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

if Filetype image is GIF

June 23, 2014 11:49am

Subscribe [2]
  • #1 / Jun 23, 2014 11:49am

    adamprocter

    228 posts

    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

    Giraffentoast

    152 posts

    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?)

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases