2

Is there any way that I can ask users for more details about the file they upload into the wiki and show it in a page where the file is used?

My wiki allows users to upload photos and books of old times that helps in digitizing a country's past. By default the MediaWiki file upload option has a description text box and not anything else. But I, as an admin, could add some custom fields like author and archived date to the file upload page so that the file they upload will have some meaningful fields?

I couldn't find any extension to do so. Is there any way that I can achieve this?

0

1 Answer 1

1
+50

I could not find an extension either, but Wikimedia Commons uses an upload form similar to what you describe. You can see it at Special:Upload if you have an account (see the screenshot below if you don't). Wikimedia Commons upload page That uses UploadForm.js, which is most likely far too complex for your purpose, although you may wish to adapt it.

A simpler way to do that is to do what some wikis such as Wikipedia do: make a template like {{Information}} that has parameters for the values you want, like author and archived date. The template should be invoked by writing something like this, where you fill in the appropriate values after the equals sign.

{{Information
 |author = 
 |archived_date = 
 |any_other_fields_you_want = 
}}

To add that automatically to the description box, add that value (replace newlines with %0A and spaces with +) to the wpUploadDescription parameter at the end of the URL, like this: http://yourwiki.com/wiki/Special:Upload?wpUploadDescription={{Information%0A+|author+=+%0A+|archived_date+=+%0A}}. You can add the link to your wiki's MediaWiki:Uploadtext, which will be shown at the top of the upload page, to prompt users to automatically fill the description box.

Edit: I thought of a different way to do this. It is not as pretty but is much easier and doesn't require any templates. Just write placeholder text in wiki markup that users can add relevant information to, like this

* '''Author:''' 
* '''Archived date:''' 
* etc.

When filled out, this would display a simple list on the file description page:

  • Author: John Smith
  • Archived date: January 1, 2015

Then follow the rest of the instructions above: take the wiki markup source, again replacing line breaks with %0A and spaces with +, and add it to the end of the URL as above: http://yourwiki.com/wiki/Special:Upload?wpUploadDescription=*+'''Author:'''+%0A*+'''Archived date:'''+. Prominently add that link to MediaWiki:Uploadtext, so users can click it to automatically fill the box with the fields you want.

11
  • Could you please help me do this @hsl?
    – arshad
    Jan 2, 2015 at 4:06
  • What should I do first? Create Template:Information? If yes, then what should be it's content?
    – arshad
    Jan 2, 2015 at 4:17
  • Yes, you would create Template:Information first, but I just thought of a simpler way that doesn't need templates. I'll add it in a few hours when I'm back at my computer. Jan 2, 2015 at 15:26
  • @arshad I've edited my answer with an easier method. Feel free to comment if you have any questions. Jan 2, 2015 at 20:48
  • What about updating those informations to the table? In which table these infos will be updated?
    – arshad
    Jan 5, 2015 at 4:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.