Skip to content
This repository was archived by the owner on Jan 20, 2021. It is now read-only.
This repository was archived by the owner on Jan 20, 2021. It is now read-only.

Image caption order or configuration option #116

@heliogabal

Description

@heliogabal

I realized that the caption gets created by either taking the alt or the title attribute into account:

Line 288 in jquery.photobox.js

// if no img child found in the link
                if( thumbImg ){
                    captionlink = thumbImg.getAttribute('data-pb-captionlink');
                    thumbSrc = thumbImg.getAttribute(that.options.thumbAttr) || thumbImg.getAttribute('src');

                    caption.content = ( thumbImg.getAttribute('alt') || thumbImg.getAttribute('title') || '');
                }

IMO it would make more sense to first look for the title, and if that's not filled out use the alt, as alt attribute is required, title optional. Even better would be an option to configure the desired behaviour:

  • use alt, then title
  • use title, then alt
  • use only alt
  • use only title

In my use case, I would want to only use title text as caption, but there are surely other possible uses. Is there a way to do this already? Or would you consider this a feasible enhancement?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions