Since upgrading to image 6.x-1.0-beta6, each image is enclosed in a div tag, for example :

<div style="width: 280px;" class="image-attach-node-21168">
<a href="/content/face-au-racisme-nous-ne-battrons-pas-en-retraite">
<img width="280" height="220" class="image image-small " title="11000_image.jpg" alt="11000_image.jpg" src="http://www.npa2009.org/sites/default/files/images/11000_image.small.jpg">
</a>
</div>

I am looking for a way to get rid of the style="width: 280px;" part, how can I do this from my theme or by hacking the image_attach module ?
By the way, is it really necessary to style the div with the image size, when the only element in the div is the image, and the image has width and height attributes ?

The reason for this is, on the news slider on my site at http://www.npa2009.org/ there used to be a white space between the images and the text, and because of that new feature in beta6, the white space is gone. I checked using Firebug that removing the style="width: 280px;" part fixes the problem.

Comments

joachim’s picture

Status: Active » Fixed

Theme override theme_image_attach_attached_images.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ice5nake’s picture

This is bad behavior IMO. Writing the width of a wrapper div in an inline style declarations feels like bad form. Updating the image module recently broke one of the sites I work on.

The hard-coded width messed up a display and FWIW it also killed my theme_image_attach_body override as this function doesn't appear to be in the module any more.

Also, this, "class="image-attach-node-21168"" doesn't seem like a very useful class.

What problem did adding the width fix?

I like that the full node information is loaded though.

Thanks for continuing to develop this module.

joachim’s picture

> Writing the width of a wrapper div in an inline style declarations feels like bad form.

The width of each image is given by the derivative size. This is a dimension specified by the site admin. So we can't use something in a stylesheet. (Unless we do what color module does and write stylesheets on the fly, which is a whole extra complication I don't want to get into.)

> What problem did adding the width fix?

We need to float n images side by side. For that we need a width.

I'm open to better ideas.

> it also killed my theme_image_attach_body override as this function doesn't appear to be in the module any more.

Yup, I made a lot of changes to the theming of attached images recently. Issues were open on these matters for ages. We're still in beta -- changes happen.

> class="image-attach-node-21168

*shrug* I figured that since nodes get a node-NID class, this might be of some use.