Can anybody think of a way of creating and prefilling missing pages on the fly? To be more specific: Is it possible to request a non-existent page with action=raw and get a default answer instead of none?
The only thing I could think of is using MediaWiki:Noarticletext and action=render. But those experiments went nowhere. The MediaWiki software seems to have little respect for the contents of that file. It still wraps it in default markup and escapes all < > and & signs. It even inserts entities for no apparent reason.
I'm stumped. Is this possible? At all? -- pecos 15:52, September 28, 2012 (UTC)
- No, you would need an extension for that. It's also not a very good idea, because then a vandal could simply travel to several hundred pages, without ever editing anything, and crowd your wiki with trash.
- Actually my question was inaccurate. I don't (necessarily) want to create the pages. The more important thing is to get a default reply when the page does not exist. Sorry about that. I'm tired. The standard page would be a template with content and non-existing pages should be served with the same template but without content.
- <rant>Theoretically this is trivial stuff. I'd just add an ErrorDocument directive and be done with it. But with MediaWiki/Wikia I'm sooooo many layers removed from the server configuration, it's not even funny anymore.</rant>
- I doubt Wikia has that - it's not really necessary either. I would assume you're writing a script, so you can simply check that there is no page content and act accordingly. You don't need to go through the complicated process of making "default" pages, which would raise many more issues down the road for you.
- Yes, I'm writing a script. It consists of two parts: the data sets (JSON) and the script that processes them. I need to keep the two parts separate right now, because the data sets may not exist and the script will either create them or simply operate on empty object. But if I could combine the two - by putting the script in a template and wrapping it around either the data set or an empty object - I could eliminate a request cycle. This is supposed to be a performance optimization. -- pecos 16:29, September 28, 2012 (UTC)