0

I've tried different combinations, but it's now working or showing up in chrome inspector...

I'm also using Bootstrap template, could that by a problem?

Or maybe I'm not filling out the information correctly in the field boxes?

enter image description here

3
  • It is behaving exactly as expected. The field formatter needs to run, and it is wrapped in the 'Field item' that you specify. In your case you specify an img wrapper which is self closing and therefore will not wrap the field at all as it will just insert a self closed img tag with no src attribute above your img field. In other words what you are trying to do (add a class to the img field) is not possible with Display Suite Mar 23, 2016 at 5:57
  • So what should I put in there so it works? Mar 23, 2016 at 6:48
  • You either override the preprocess or theme functions for image / image style (google: drupal add class to image) or you add a div around the image via Display Suite and target the enclosed image via CSS via that parent. Then just add the CSS for responsive image (I assume that is what you want) to that. Just duplicate it from the Bootstrap CSS class img-responsive. Bootstrap is nice but it does force you to add specific classes to your html at times which may not always be easy-as-you-go. Just work around it. Mar 23, 2016 at 7:06

2 Answers 2

1

Have you tried Image Class.

Extends the Image formatter by adding an option to add an element class.

It does not work in combination with Display Suite unfortunately as per this post: Merge Image Class into Display Suite

0

Ok, got it figured out.

It didn't work because I had nothing selected for:

 "Use custom display settings for the following view modes"

So I had to select "full content" then use that one for custom fields.

The default tab page doesn't work....

So using only default will NOT work, you MUST have a custom diplay.

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.