The "alt" field (alternate text) of the "img" tag is designed to replace the image in cases the picture cannot be seen and only in this case. But, in Flex Slider, its content appears along with the picture, as the content of "title" does (except that the content of "title" appears in bold).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

minorOffense’s picture

Priority: Normal » Minor
Status: Active » Needs work

That shouldn't be an issue with 2.x

If you feel like rolling a patch for 1.x I'd be glad to fix it. But for the moment it's a lower priority issue. But you are most certainly correct, the alt text shouldn't be rendered as part of the caption.

Fiable.biz’s picture

Status: Needs work » Patch (to be ported)
FileSize
578 bytes

I just deleted one line in flexslider-container.tpl.php . Here you are:

<?php
/**
 * @file
 * Default output for a Flex Slider node.
*/
?>
<div class="flex-nav-container">
  <div class="flexslider-content flexslider clearfix" id="flexslider-<?php print $id; ?>">
    <ul class="slides">
    <?php foreach($items as $item) : ?>
      <li><?php print render($item); ?>
        <?php if(!empty($item['#item']['title']) || !empty($item['#item']['alt'])) : ?>
         <div class="flex-caption"><strong><?php print $item['#item']['title']; ?></strong>
         </div>
        <?php endif; ?>
      </li>
    <?php endforeach; ?>
    </ul>
  </div>
</div>
Vincent_Jo’s picture

Issue summary: View changes

Hi,
this patch (#2) works for me.
The alt-text isn´t displayed any more along with the image-title.

Thanks for that.

Actually I´ve been looking for a way to add custom captions on an image field flexslider.
Any chance?

regards
Vincent

jenlampton’s picture

Status: Patch (to be ported) » Needs review

I think the status on this one should be "Needs review" as it doesn't look like this patch has been committed to any other branch.

  • minorOffense committed 1e2a3d8 on 7.x-1.x
    Issue #1879564: Alternate text appears with the image
    
minorOffense’s picture

Status: Needs review » Fixed

I've fixed the 1.x version of the module but it doesn't appear to be a problem in 2.x since you aren't limited to images in 2.x of flexslider.

Status: Fixed » Closed (fixed)

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