2

SEE: http://ellislab.com/expressionengine/user-guide/modules/channel/custom_fields.html#variable-pair-usage

I have my images resized to multiple thumbnail sizes. How do I access the url, height, and width of a specific image thumbnail? I tried something like this:

{my_image_file:150x100}
   {url}, {height}, {width}
{/my_image_file:150x100}

It didn't seem to work. Instead, it looks like I was getting the original image (instead of the thumbnail). Suggestions?

Note: I'm using Matrix. Not sure if it matters. But there is an outer tag pair to loop through all the my_image_file.

UPDATE 1:

I thought this worked:

{my_image_file}
   {url:150x100}, {height:150x100}, {width:150x100}
{/my_image_file}

It only worked for url

  • Is 150x100 actually the name of the image manipulation you setup in your file upload preferences? – Derek Hogue Feb 1 '13 at 19:34
  • Yes. If I were not trying to access the height and width, I can access the URL like this: my_image_file:150x100. – ExpressionEngineNewbie Feb 1 '13 at 19:54
  • Does {my_image_file:150x150:width} work? – Derek Hogue Feb 1 '13 at 20:04
  • No, it returns a URL, something like this: site.com/uploads/inventory/_150x100:width/82521351.jpg – ExpressionEngineNewbie Feb 1 '13 at 21:01
  • I wonder if this is related to the longstanding egregious bug, where you upload an image, go to the edit tab, change the dimensions of the image, save it, and click use this image and it generates a tag with the original dimensions? what does {height:150x100} return? The original image height? – UltraBob Feb 6 '13 at 4:49
2

This works for me, tested in EE2.5.5 and Matrix 2.4.1

{my_image_file}
{url:150x100}, {height}, {width}
{/my_image_file}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.