Since the field wrappers were removed (see #2140663: Flexslider fields does not contain field tpls due to code revert from alpha2) there are few options for distinctly styling flexsliders, especially if there are multiple on a page (see #1866740: Impossible to have two+ sliders on same page regarding to the size of image).

Targeting flexslider-ID does not cut it when the flexsliders are optional. (Who knows which one #flexslider-1 will be?)

Others besides me are looking for more CSS options (see #1948244: Enhance CSS namespace styling).

I propose adding the name of the optionset and the name of the image style each as classes on the flexslider container div. This will give users more flexibility when styling flexsliders.

Comments

tommyk’s picture

This patch adds the optionset name and the image style name as classes on the flexslider container div.

tommyk’s picture

Issue summary: View changes
das-peter’s picture

StatusFileSize
new1.14 KB

Exactly what I was looking for - however I suggest to use drupal_clean_css_identifier() to get proper css classes and be more defensive with $settings['image_style'] as this isn't necessarily available all the time.
Updated patch attached.

jenlampton’s picture

Status: Needs review » Reviewed & tested by the community

A good improvement, and works as described. Thanks! :)

minoroffense’s picture

I'm ok with the patch. But I'm pretty sure with the latest build that image style is always blank (the option set doesn't store the stud anymore).

minoroffense’s picture

Status: Reviewed & tested by the community » Fixed

Minor adjustment. Going to run it through drupal_html_class() instead to ensure it gets lowercased.

Patch applied.

  • minorOffense committed 5332174 on 7.x-2.x authored by das-peter
    Issue #2458899 by TommyK, das-peter: Add classes for optionset and image...

Status: Fixed » Closed (fixed)

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