I am trying to get the machine name of the responsive image style attached to a field. I am not able to get this from the settings attached; it seems it is not accessible from the object in any way.

How can I get the responsive image style ID from a FileFieldItemList?

  • I am not sure what you are asking. What are you trying to accomplish? Commented Jun 21, 2016 at 16:08
  • The image style won't be accessible on the field type, but it is probably accessible for a field formatter. Can you provide more details or code around where you are trying to get the machine name and for what purpose? Are you trying to format an image field?
    – mradcliffe
    Commented Jun 21, 2016 at 17:09

1 Answer 1


This setting is not a field setting. Because a field can be part of different displays. You have to look for this setting in a view mode. For example if you configure the image field of the article with a responsive image style, your view mode would contain something like this:

      type: responsive_image
      weight: 0
        responsive_image_style: *responsive_image_style_id*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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