Page MenuHomePhabricator

Replace fixed length filename truncation in galleries with CSS solution
Closed, ResolvedPublic


Currently filenames in captions are truncated to a fixed length (default 25). We could truncate captions to one line (however long it may be) using just CSS.


Related Gerrit Patches:

Event Timeline

Esanders created this task.Jul 8 2016, 4:23 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 8 2016, 4:23 PM

Change 298020 had a related patch set uploaded (by Esanders):
Truncate gallery caption filenames with CSS

Restricted Application added a subscriber: Matanya. · View Herald TranscriptJul 8 2016, 4:44 PM
matmarex added a subscriber: matmarex.

There is a site script on Commons that un-truncates them on category pages. It'll need to be replaced with a piece of site styles that will do the same thing.

Restricted Application added subscribers: Poyekhali, Steinsplitter. · View Herald TranscriptJul 8 2016, 6:45 PM
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF moved this task from Untriaged to Needs code review on the Multimedia board.

From the Gerrit task:

@Esanders wrote:

The following CSS can be added to replace the long filenames gadget on commons:
/* Long filenames on category pages */
#mw-category-media .galleryfilename-truncate,
/* Long filenames on special pages (new files etc.) */
.ns-special .galleryfilename-truncate {

white-space: normal; 
overflow: visible;


Change 298020 merged by jenkins-bot:
Truncate gallery caption filenames with CSS

matmarex closed this task as Resolved.Jul 18 2016, 11:39 PM