Ticket #6368 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

Gallery display enhancements

Reported by: tellyworth Owned by: matt
Priority: normal Milestone: 2.8
Component: Gallery Version:
Severity: normal Keywords: has-patch
Cc:

Description

This makes the [gallery] output more configurable and useful. Changes include:

  • 'Description' (excerpt) is now 'Caption'
  • Captions are displayed below thumbs in the main gallery display
  • Thumb gallery markup is improved (dl/dd/dt for icon and caption display, tags are configurable by attributes like [gallery itemtag="div"] if necessary)
  • Parent id is selectable, e.g. [gallery id=123]
  • Icon size is selectable, [gallery size="medium"]
  • Column count is selectable, [gallery columns=4]
  • Order is selectable, [gallery orderby="post_title"]

I think some of these attributes should have a UI, where you click on the Insert Gallery Into Post button, but that's not included in this patch.

The dl/dd/dt method of marking up images with captions is discussed and recommended here:

 http://www.dzr-web.com/people/darren/blog/2005/02/09/image-captions-in-xhtml/  http://www.tjkdesign.com/articles/how_to_style_thumbnail_and_caption.asp

Attachments

gallery-improvements-r7493.patch Download (3.9 KB) - added by tellyworth 4 years ago.
gallery-improvements-r7493-2.patch Download (4.5 KB) - added by tellyworth 4 years ago.

Change History

comment:1   ryan4 years ago

  • Status changed from new to closed
  • Resolution set to fixed

(In [7496]) Gallery display enhancements from tellyworth. fixes #6368

comment:2   DD324 years ago

  • Status changed from closed to reopened
  • Resolution fixed deleted

after [7496], when i insert a gallery into a post, i get this:

Fatal error: Call to undefined function tag_escape() in C:\www\wordpress\wp-includes\media.php on line 367

comment:3   matt4 years ago

Confirmed.

Sorry, missed a file out of the patch. The second version should fix it.

comment:5   matt4 years ago

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [7497]) Bring in forgotton tag_escape. Fixes #6368.

  • Status changed from closed to reopened
  • Resolution fixed deleted

I have to disagree with using definition lists in the gallery, a list of one does not make sense, either logically or how HTML is intended to be used.

For example, assistive technologies like screen readers provide navigation short-cuts for lists (and headings, links etc). So you would get to a gallery, and oh, it's a list, great. I'm not that interested in the list so you try and skip over it... to another list, and another etc.

The reason I re-opened this bug rather than just rely on [bug 6927] is that the 'itemtag' option doesn't allow you to use, for example, a proper list. I.e. where the gallery is a list (e.g. ul) and each item is a list item (li).

Would it be possible to change this to defining the top item (e.g. dl, ul, div), and have the function automatically pick the right per-image element? (e.g. dt, li, div).

At the moment I've hacked together a gallery shortcode replacement to output simplified code (including alt text), but it is a hack (I'm not a programmer), it would be better if the core could output accessible code by default.

I included two examples of desired output here:  http://alastairc.ac/notes/web-applications/wordpress/clean-gallery/#code-changes

I'm happy to work on the front-end code stuff, but I'm not the person for PHP changes...

  • Milestone changed from 2.5 to 2.7

comment:8   ryan3 years ago

  • Milestone changed from 2.7 to 2.8

Moving enhancements to 2.8.

comment:9   ryan3 years ago

  • Component changed from General to Gallery
  • Milestone changed from 2.8 to 2.9

Moving enhancements to 2.9.

  • Status changed from reopened to closed
  • Resolution set to fixed
  • Milestone changed from 2.9 to 2.8

Fixed since r7497. Please open a separate ticket (with a patch) for the definition list issue.

Note: See TracTickets for help on using tickets.