This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

kevin.vermeulen
kevin.vermeulen

Hi all,

I want to know how I get the value of the imageWidth and imageHeight of a featured image in my template?
Already have this code:

{% if post.featured_images.count %}
 {% for image in post.featured_images|slice(0, 1) %}
  {{ image.imageWidth }}
 {% endfor %}
{% endif %}

Last updated

Algad
Algad

You can use the code below, in order to see image properties.

{{ dump(image) }}

Last updated

kevin.vermeulen
kevin.vermeulen

Algad said:

You can use the code below, in order to see image properties.

{{ dump(image) }}

Thank you Algad!

It's strange when I do it for the featured images of Rainlab.Blog plugin, because I can use for example: {{ image.title }} in my template and if I dump the image like you said I only get these information:

So no image.title or image.description..

Object variables System\Models\File getPublicPath() method Define the public address for the storage path. getStorageDirectory() method Define the internal storage path.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.