I've defined an amazon field on my blog nodes that allows multiple amazon items to be added.

If I add multiple items, when the node is displayed the items are run together and displayed badly.

The display is fixed if, in amazon-item.tpl.php, the outer div is changed to have style=clear:both as below:

<div class="<?php print $classes; ?>" style="clear:both">
CommentFileSizeAuthor
#2 amazon.css20090719.patch1.1 KBiva2k

Comments

tcblack’s picture

I believe this is a CSS issue. I applied the change you suggested and saw no difference. The problem is caused by floating the image left in the CSS. This causes each successive image to be floated left but they appear to be nested because that's the way floated images flow.

Rather than floating left, turn off the float with float:none and the problem goes away.

Alternatively play with the amazon.css file to get what you're looking for.

iva2k’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

I rolled a patch against 6.x-1.x-dev, which fixes this issue in amazon.css file.

I also noticed that amazon.css is not always loaded if CSS optimization is enabled, so I moved drupal_add_css() into amazon_init() function in amazon.module.

Please review for commit to 6.x-1.x-dev. I believe the CSS part of it applies directly to 6.x-2.x-dev.

function theme_amazon_item() may need to be changed in 6.x-2.x-dev if CSS optimization remains an issue.

rfay’s picture

If you've tried this patch and it resolves these issues, please mark the patch RTBC. Not @iva2k, of course.

rfay’s picture

Status: Needs review » Fixed

Committed with slight change (targeted field-type-asin instead of .amazon-item) - http://drupal.org/cvs?commit=270920

Please test in the dev version when it's updated and let me know if there are any issues.

Status: Fixed » Closed (fixed)

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