Hi there,
I'd like to use MediaWiki as a storage for some kind of items, which doesn't have "natural" titles (just like bugs in Bugzilla). So I'd like to allow user to create new article without specifying the title and I want the system to generate the unique title by itself. The best solution I see here is to use consequent numbers in particular namespace -- e.g. when user clicks "Add item" the system allows he or she to fill in some form (with textareas and other input fields) then creates an article containing the data from this form (by template) and a title like "Items:1234" (assuming we already have "Items:1233").
Is it possible to implement such a feature as an extension?
Actually, I see that it can be done using external script which communicate with MediaWiki via API, but I'm not sure it'll be reliable in sense of collisions (e.g. if two users click "Submit" almost simultaneously, they can both obtain the same ID for their articles and data will be lost or editing conflict occurs).
Thanks,
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ilya "Voyager" Schurov wrote:
I'd like to use MediaWiki as a storage for some kind of items, which doesn't have "natural" titles (just like bugs in Bugzilla). So I'd like to allow user to create new article without specifying the title and I want the system to generate the unique title by itself. [snip]
The way I'd do this is for one namespace, disable all new page creations. Then create a new special page that acts as a new page interface sans the title requirement. When it gets submitted, the database assigns it a title (using a counter table to determine which ID to use) and creates a new page normally. It sounds doable, although it will probably require some hackery in EditPage.php.
Edward Z. Yang wrote:
The way I'd do this is for one namespace, disable all new page creations. Then create a new special page that acts as a new page interface sans the title requirement. When it gets submitted, the database assigns it a title (using a counter table to determine which ID to use) and creates a new page normally. It sounds doable, although it will probably require some hackery in EditPage.php.
Edward, thank you for reply.
As far as I understand, I don't need to turn off new page creations. It can lead to some editing conflict, but it doesn't seems to be very serious problem here. (BTW, is it possible to turn off new article creation only for one particular namespace?).
I'd like the idea of using custom SpecialPage as a way to create alternative new page interface. However, I can't realize how to save the brand new article when user click "Submit" in the special page's form. I dislike the idea to re-implement EditPage.php here :)
Any links to code samples are very appreciated.
Each article has an ArticleId. So you want to make Titles = ArticleId. When someone gives you a title, convert to number and treat as ArticleId. Plus 'touching' the editpage for not requiring a title.
PS: Are you sure it's a wiki what you need?
wikitech-l@lists.wikimedia.org