Community Wishlist Survey 2021/Multimedia and Commons/Upload to current category

Upload to current category

  • Problem: When you find the correct category for your images, you have to upload it and then type the category. There are lots of images that could be better categorized directly if uploaded to that category.
  • Who would benefit: Everyone who uses Commons, both newbies (I want to upload something to this category) and experienced users (who are good with categories)
  • Proposed solution: Add an "Upload to this category" button to every Commons category in the top. This should have a prefilled category when uploading.
  • More comments:
  • Phabricator tickets:
  • Proposer: Theklan (talk) 09:37, 20 November 2020 (UTC)[reply]


The following snippet in your commons:Special:MyPage/common.js

if (mw.config.get('wgNamespaceNumber') === 14) {
	$(function () {
		// upload in cat
		mw.util.addPortletLink('p-cactions', '//' + encodeURIComponent(mw.config.get('wgTitle')), 'Upload to this category', 'UW');
			'<a href="//;categories=' + encodeURIComponent(mw.config.get('wgTitle')) +
			'" title="Upload to this category">' +
			'<img alt="Upload to this category" src=""' +
			' style="vertical-align:sub" height="30" width="30">' +

does the magic. Could be added to the global config to allow for all users. --Herzi Pinki (talk) 19:00, 20 November 2020 (UTC)[reply]

@Mike Peel: Not all categories have the infobox. I have checked now the featured picture, for example, and it doesnt: c:Category:Point_Reyes_headlands. When looking to a category with the template, indeed, the link is there, but it wans't obvious that the link would upload an image to that category, because the text is not explicit (this has a really easy solution).
@Theklan: It's present in around 50% of categories now. It could easily be added to the rest, but we've been trying to add it at the same time as the Wikidata sitelinks - although the unlinked version still displays the upload link. The text is commons:MediaWiki:Cx-contributions-upload, if there's a better ux string that can be used while keeping things multilingual, I'm happy to change it! Thanks. Mike Peel (talk) 13:55, 3 December 2020 (UTC)[reply]
@SWilson (WMF): It's not about me, it is about new users who are not used to our tricks (snippets, special codes...). -Theklan (talk) 09:36, 3 December 2020 (UTC)[reply]
  • This feature would be great for campaign organizers that seek attract new collaborators. I know that there are other tools for campaigns, but this button is helpful for understand that you are participating in a campaign by adding the file to a category. Many new users that want collaborate in a specific campaign aren't aware of categories.--Señoritaleona (talk) 00:25, 19 December 2020 (UTC)[reply]