Forum:Using Javascript to parse the preloaded template on new page edit

Okay, so here's what I'm working on:

http://open4e.wikia.com/wiki/Test

Now, this page was generated really simply - the user just has to type in:

And the page does the rest.

So, the page uses DPL to search for a page with the categories 'Class feat' and 'Trance', and transclude it into that page. If it doesn't find one, it puts up a CreateBox so you can make one.

If you supply a page name of "Primal Bond" and click on that "Create" button, it will take you to the new page's edit page, preloaded with:

What I really, REALLY want, is for some clever way to do the following:


 * 1) name the new page "primal bond" instead of "Primal Bond"
 * 2) Replace %page_name% with the string "Primal Bond", as supplied by the CreateBox
 * 3) Replace %class feature% with the string "Nature's Ally", supplied as a form parameter from the previous page - this is REALLY IMPORTANT, because this is what causes DPL to know that it belongs on the previous page!
 * 4) Have a drop-down on the last page's CreateBox, the results of which replace %action%

Any ideas?

Ialdabaoth WoD (talk) 19:48, September 7, 2012 (UTC)


 * I could help with the first one:


 * I'm not sure that you can have multiple forms on a CreateBox, it's not like an HTML where you can have multiple boxes. If "Nature's Ally" is the name of the previous page, you could just put "Nature's Ally" in the code. If not, I'm not sure what you're asking. The others, unless I'm mistaken, are only possible using literal HTML code. If you want to, I'm sure someone could whip something up. Iggyvolz (Message Wall) 20:13, September 7, 2012 (UTC)
 * Well, that won't work in this case, because the page is going to get transcluded all over the place - and I need the name of the *source* page, not the page it's transcluded on. But ultimately, that's just part of the %parameter% problem - hence the need for javascript to parse through the ?preload= text.

Ialdabaoth WoD (talk) 20:28, September 7, 2012 (UTC)
 * If you can substitute the template, you can put, which will lock when the template is substituted. ~

UPDATE!

http://www.mediawiki.org/wiki/Extension:Autoedit

This saved my bacon.