Get your own customer support community
 

Tutorial: Organize how the templates appear and remove default templates from the list on the NewPage

[EDIT] This page won't allow me to show you the scripts, check this link out for this same text with the code shown http://magicwiki.pbwiki.com/f/Tutoria...

Hey guys, until PBWiki allows us to set the order of the template list, and which templates to display, here's a quick and dirty workaround. For an example of how I'm using this in my own Wiki, check http://magicwiki.pbwiki.com/New-Page

First, you'll need to create a new page and name it NewPage. Next you'll need to add a new "HTML/JavaScript Plugin", check "Allow JavaScript" and Copy+Paste

the following:




This function determines how to create the page by checking the Name you assigned it, and the template to use. Next, create another plugin and add the

following to it:



This function actually creates the page. Simply change WIKINAME to the name of your wiki. Now we need to create the forms the users will interact with,

including the Name, the creation button, the folder to store the page in, the security settings, and the template to use. To add the Name field and Create

Page button, add another Plugin with the following:



For the Folder, add the following into another Plugin:



Next, the security settings in a separte Plugin:



And finally, the list of templates to use:




It's that easy. The only thing you need to do is manually enter in the templates you want to use, and manually update the folder list. You'll also need to provide the user with a link to this page, as I don't know how to edit the "Create a Page" button at the top of the screen to redirect you to your new "Create a Page" page. Anyways, I hope this tutorial helps!
 
happy I’m excited
Inappropriate?
1 person likes this idea

User_default_medium