Forums: Index → Community Central Forum → Image titles in categories. Need CSS/JS fix to allow more than 20 characters
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
To contact staff directly or to report bugs, please use Special:Contact.
More of image filename visible in categories
This is something that has bugged me a long time. Both on Wikia and Wikipedia.
See: http://cannabis.wikia.com/wiki/Category:Cannabis-related_event_graphics
It seems that only 20 characters (that includes spaces) are allowed to be shown. This prevents easy scanning of the image titles to see what the image is about.
Is there a JS and/or CSS fix for this? --Timeshifter 01:00, May 14, 2011 (UTC)
- JS:
$(function () {$('.gallerytext a').each(function() {this.innerHTML = this.title;});});
- Much easier than I thought it would be. Luckily, the title of each link is the full name of the picture. Monchoman45 Talk Contribs Skystone 01:15,5/14/2011
- Monchoman to the rescue! I tested in Special:MyPage/wikia.js (on WoWWiki) and it works! Whats the easiest way to remove the "File:", though? -- Fandyllic (talk · contr) 13 May 2011 6:29 PM Pacific
- Change
this.title
tothis.title.substring(5, this.title.length)
. Monchoman45 Talk Contribs Skystone 01:35,5/14/2011
- Change
- Sweet! Thanks. See:
- http://cannabis.wikia.com/wiki/MediaWiki:Common.js
- http://cannabis.wikia.com/wiki/Category:Cannabis-related_event_graphics
- http://cannabis.wikia.com/index.php?title=Category%3ACannabis-related_event_graphics&useskin=monobook
- http://cannabis.wikia.com/index.php?title=Category%3ACannabis-related_event_graphics&useskin=vector
- --Timeshifter 21:54, May 14, 2011 (UTC)
- I believe this has been asked for many times on Wikipedia/Wikimedia. Why are the developers there so clueless about such a simple fix? --Timeshifter 21:54, May 14, 2011 (UTC)
Choose number of characters to allow
I would like some JS to choose the number of filename characters/spaces that are visible in categories. Both for wikis on Wikia, and to suggest to this Wikimedia Commons discussion:
I would like some JS where I can plug in whatever number I want. ----Timeshifter (talk) 11:15, December 1, 2011 (UTC)
- Isn't it easier to just show the whole thing? There are filenames that are quite long, yes, but generally aren't those ones you'd have to fix? Monchoman45 Talk Contribs Skystone 12:36,12/2/2011
- This is true for the cannabis wiki, but there are some wikis with many more images. And so finding the very long filenames can be difficult. Also, I want to pass this info on to the Wikimedia Commons which has millions of images. ----Timeshifter (talk) 13:58, December 2, 2011 (UTC)
- Wikimedia Commons has implemented a gadget to allow this. See: commons:MediaWiki talk:Common.js#Length of image filenames visible in categories. ----Timeshifter (talk) 07:21, December 4, 2011 (UTC)