Using Zurb Interchange for the first time and it appears to be a very useful module and a great compliment for Foundation.

I've noticed when using the "Set as a background image…" option that styles intended for the Interchange div are also being applied to the the next field in a display.

Here's an image field displayed with a IMG tag…

<div class="field field-name-field-slide-backgrouund field-type-image field-label-hidden field-wrapper">
	<img alt="Race Farm" src=IMAGE PATH..." typeof="foaf:Image" data-interchange="[INTERCHANGE DATA...]" data-uuid="interchange-ibjsak8u0">
</div>
<div class="text-content">Some text</div>

Now here's the same two fields with the DIV option turned on…

<div class="field field-name-field-slide-backgrouund field-type-image field-label-hidden field-wrapper">
	<div data-interchange="INTERCHANGE DATA..." data-uuid="interchange-ibjs3b160">
	</div>
	<div class="text-content">some text</div>
</div>

Somewhere, a closing DIV tag is being dropped, likely in zurb_interchange_preprocess_field(). I'm guessing the function is just taking the IMG tag ( which doesn't have a closing tag) and changing it's name to DIV (which requires a closing tag).

Note: I'm using this module along with the latest Foundation base theme. And while I have added a lot of custom theme functions and layouts, I don't see any signs they're messing with this field.

Comments

johnodonnell@mac.com’s picture

I found it!

theme_html_tag() requires the #value attribute to be set before it will create a closing tag. Setting #value to an empty string forces it to add that tag.

I added the following after line 202 of zurb_interchange.module

$variables['items'][$key]['#value'] = ''; // required to create a closing tag