Hi Manuela,
I am sure you can do this by using the standard object model and extension interface of
MediaWiki. I really advice against manipulating the database directly. Maybe you could
even use the "Action API" of MediaWiki:
1. Use the parser hook / special page to create the desired form
(
https://www.mediawiki.org/wiki/HTMLForm)
2. Create a resourceloader module to load javascript
(
https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoadeā¦)
3. When the user submits the form, assemble the wikitext from the form fields and use
the "Action API" to create/edit the wikipage
(
https://www.mediawiki.org/wiki/API:Edit,
https://doc.wikimedia.org/mediawiki-core/REL1_31/js/#!/api/mw.Api.plugin.edā¦ and
https://doc.wikimedia.org/mediawiki-core/REL1_31/js/#!/api/mw.Api )
--
Robert
________________________________
Von: MediaWiki-l <mediawiki-l-bounces(a)lists.wikimedia.org> im Auftrag von Manuela
<pressephotografin(a)gmail.com>
Gesendet: Dienstag, 29. Januar 2019 12:54
An: mediawiki-l(a)lists.wikimedia.org
Betreff: Re: [MediaWiki-l] Extension which creates a Wikipage with content
Robert Vogel wrote
it looks like the source of the issue is, that you try
to create a wiki
page from within a parser hook callback. This is very uncommon. It somehow
messes with the global state of the Parser.
Do you have your code online somewhere? Maybe github.com? This would
probably be a better place to discuss implementation details. Or maybe you
could give some details of your use case.
Hi Robert,
thank you for your answer. I have already thought about that. What would be
a better way, a Special-Page Extension?
I had the idea of entering a page title and some initial content into a form
and creating a new page from that. This is the way how many users would
expect it to work, and obviously there is no simple way in MediaWiki to do
so.
My code is really simple, just creating the hook, defining a test page title
and test content and trying to create a page from that. I will post the full
code this evening.
If there is no simple way I must go the hard (and dirty) way and use SQL for
directly accessing the database,
greetings
Manuela
--
Sent from:
http://mediawiki-i.429.n8.nabble.com/
MediaWiki-I | Mailing List
Archive<http://mediawiki-i.429.n8.nabble.com/>
mediawiki-i.429.n8.nabble.com
MediaWiki-I forum and mailing list archive. MediaWiki announcements and site admin list
This is a multilingual list for help/support with running/configuring MediaWiki. It is
intended for people who...
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l