Hi, based on commit hash 7c0b80fd23358f8afbd0d19d32f7b33d99f8b553 in flexslider_fields_field_formatter_view(), the $element array should have had a nested array of items so it looks like $element[] = .... Instead, the commit removes that line and is replaced with $element = .... As a result, a field output with flexslider looks more like

<div  id="flexslider-1" class="flexslider">
  <ul class="slides"><li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/Thanksgiving.jpg?itok=ehMgyZaA" width="350" height="350" alt="" title="No Teen Event November 27th- Happy Thanksgiving!" /><div class="flex-caption">No Teen Event November 27th- Happy Thanksgiving!</div></li>
<li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/The%20Great%20Gatsby%20Movie_0.jpg?itok=UW1w87Rf" width="233" height="350" alt="" title="November&#039;s Book-to-Film Screening: &quot;The Great Gatsby&quot;" /><div class="flex-caption">November's Book-to-Film Screening: "The Great Gatsby"</div></li>
<li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/IMG_3706_0.JPG?itok=RTt2xS6w" width="467" height="350" alt="" title="Halloween Fun at the Library- Cutie Pumpkins &amp; Banana Ghosts" /><div class="flex-caption">Halloween Fun at the Library- Cutie Pumpkins &amp; Banana Ghosts</div></li>
<li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/Gingerbread%20House%20Decorating%202013_0.jpg?itok=ngEuooV7" width="453" height="350" alt="" title="A Holiday Tradition at the Library- Coming this December!" /><div class="flex-caption">A Holiday Tradition at the Library- Coming this December!</div></li>
<li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/How%20I%20live%20now.jpg?itok=hblw4Wco" width="237" height="350" alt="" title="December&#039;s Teen Book of the Month Club Pick" /><div class="flex-caption">December's Teen Book of the Month Club Pick</div></li>
</ul></div>
<div class="field field-name-field-hero-images field-type-image field-label-hidden"><div class="field-items"><div class="field-item even"><div  id="flexslider-1" class="flexslider">
  <ul class="slides"><li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/Thanksgiving.jpg?itok=ehMgyZaA" width="350" height="350" alt="" title="No Teen Event November 27th- Happy Thanksgiving!" /><div class="flex-caption">No Teen Event November 27th- Happy Thanksgiving!</div></li>
<li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/The%20Great%20Gatsby%20Movie_0.jpg?itok=UW1w87Rf" width="233" height="350" alt="" title="November&#039;s Book-to-Film Screening: &quot;The Great Gatsby&quot;" /><div class="flex-caption">November's Book-to-Film Screening: "The Great Gatsby"</div></li>
<li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/IMG_3706_0.JPG?itok=RTt2xS6w" width="467" height="350" alt="" title="Halloween Fun at the Library- Cutie Pumpkins &amp; Banana Ghosts" /><div class="flex-caption">Halloween Fun at the Library- Cutie Pumpkins &amp; Banana Ghosts</div></li>
<li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/Gingerbread%20House%20Decorating%202013_0.jpg?itok=ngEuooV7" width="453" height="350" alt="" title="A Holiday Tradition at the Library- Coming this December!" /><div class="flex-caption">A Holiday Tradition at the Library- Coming this December!</div></li>
<li><img typeof="foaf:Image" src="http://pitkin.chillco.dev:8082/sites/default/files/styles/hero_images/public/hero-page/How%20I%20live%20now.jpg?itok=hblw4Wco" width="237" height="350" alt="" title="December&#039;s Teen Book of the Month Club Pick" /><div class="flex-caption">December's Teen Book of the Month Club Pick</div></li>
</ul></div>
</div></div></div>

missing all the outside divs. While not suffering from divitis is a noble goal, I think that is better left to field level overrides or semantic field module or somesuch (ie it can be overridden someplace) than in a field view formatter.

CommentFileSizeAuthor
#1 2140663.patch520 bytesBTMash
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BTMash’s picture

Status: Active » Needs review
FileSize
520 bytes

Attaching patch.

minorOffense’s picture

We did so on purpose to ensure that the field templates/styles didn't get in the way of the flexslider instance.

I'm debating that decision now but still leaning towards omitting the field template unless someone can provide a reason or use case to include them.

I realize that fences or other modules can help reduce the markup, but why not have FlexSlider just set the markup as required?

BTMash’s picture

In my case, part of the issue came up with how the css by the designer had been set up - it was targeting a field instance (instead of the flexslider by id) to apply the necessary markup and adjustments. With the removal of the field templates, it required adjustment (and made it less flexible when different fields using flexslider on the site that need to look different now look similar to each other since there is no other contextual information regarding the flexslider instance (if that makes any sense).

minorOffense’s picture

Status: Needs review » Needs work

You could restore the templates from earlier versions into your theme and restore the wrapping elements.

As for rendering multiple fields with different styles, I'll mull that over and see if I can find a solution that meets both our requirements. (maybe has a field setting to add a class or get the field classes and put them on the container)

But I won't put the field template wrapping stuff back in.

BTMash’s picture

I'm not wholly understanding what the workaround is supposed to be when the changes have happened in flexslider_fields_field_formatter_view

TommyK’s picture

Ability to add a class in the field settings would help immensely to style flexsliders differently.

Use case:

We have 2 different image fields on a content type. One for a single "main image" and one for multiple "slideshow images". If we use one or the other they each get a "flexslider-1" ID when they are used.

troybthompson’s picture

I have the same issue, two image fields, one formatted as a callout, and one full width. I have to go through css contortions to try to specify which one I want. Is there any other field formatter that erases the field class? I don't see the advantage of removing standard information. If someone happens to use css that breaks the slideshow, they should have the knowledge to fix it. If someone decides to change a static image to a slideshow, currently all the formatting targeted for that field breaks.