Ticket #6368 (reopened enhancement)

Opened 3 months ago

Last modified 2 months ago

Gallery display enhancements

Reported by: tellyworth Assigned to: matt
Priority: normal Milestone: 2.7
Component: General 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 (3.9 kB) - added by tellyworth on 03/24/08 00:53:45.
gallery-improvements-r7493-2.patch (4.5 kB) - added by tellyworth on 03/24/08 05:04:32.

Change History

03/24/08 00:53:45 changed by tellyworth

  • attachment gallery-improvements-r7493.patch added.

03/24/08 02:57:20 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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

03/24/08 04:38:17 changed by DD32

  • status changed from closed to reopened.
  • resolution 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

03/24/08 05:01:58 changed by matt

Confirmed.

03/24/08 05:04:32 changed by tellyworth

  • attachment gallery-improvements-r7493-2.patch added.

03/24/08 05:05:06 changed by tellyworth

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

03/24/08 05:15:29 changed by matt

  • status changed from reopened to closed.
  • resolution set to fixed.

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

05/07/08 12:29:32 changed by alastc

  • status changed from closed to reopened.
  • resolution 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...

05/09/08 10:37:31 changed by thee17

  • milestone changed from 2.5 to 2.7.