<li></li>
around it, it shows up. Drawback: the icon is the standard “edit” pencil, and I did not see how to change it.This is an old revision of the document!
Table of Contents
New Page Dialog Plugin
Compatible with DokuWiki
weatherwax, binky
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to addnewpage, addnewpagedeluxe, new_page_dialog
Installation
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
Add Button to Template
Decide where you want to insert the “Create New Page” button in your template and insert the following code:
if (!plugin_isdisabled('npd') && ($npd =& plugin_load('helper', 'npd'))) { $npd->html_new_page_button(); }
Most likely you want to do that in the /lib/tpl/default/main.php
inside the <div id="bar__bottomright"/>
as follows:
<div class="bar-right" id="bar__bottomright"> <?php if (!plugin_isdisabled('npd') && ($npd =& plugin_load('helper', 'npd'))) $npd->html_new_page_button(); ?> <?php tpl_button('subscription')?> <?php tpl_button('admin')?> <?php tpl_button('profile')?> <?php tpl_button('login')?> <?php tpl_button('index')?> <?php tpl_button('top')?> </div>
Note that the button will only be shown if the browser is JavaScript enabled.
Exception: The template DokuBook has the New Page Dialog-button automatically added.
Examples/Usage
This plugin solves a pain point for many newcomers to wikis: How to create a new page. It focuses on the way people are used to storing files and aims to resemble a regular “Save As” dialog with “Add Folder” functionality.
Clicking on the button opens this pop-up which allows to create new folders and pages in existing folders.
Configuration and Settings
Plugin NTP Link Type
If set to link
(Default), will generate a HTML link element. Otherwise the setting button
will create a form element with a button, approximately like this:
<form> <div class="no"> <input class="button" />; </div> </form>
Choose this according to your template.
Development
This plugin has been adopted from new page dialog plugin by Pierre Spring.
Change Log
- 2014-01-23
- Initial release
- Compatible with DokuWiki version after Angua
- Removes confirmation dialog
FAQ
Discussion
No-name behaviour and integration
Dear author of this plugin, thanks for the plugin and some feedback: I like the general idea and I tried it for our local wiki, because I see the same problem for new users as you. However, two points finally stopped me using it, and I would like to inform you about them :
- Plugin accepts “no name” creation: The more important point. In the dialog box, creation of a page is possible without typing the name. A default name is then assumed (I think it was “page title”). This will lead to many pages with this standard name all over the namespaces, because people tend to forget (or to understand). It should IMHO rather refuse to create a page if no name was typed (silently or infobox).
- The integration into the template proved to be a bit difficult, although I got more or less there in the end. 1) Obviously, this is primarily a template question, but on the plugin side, a more flexible integration might be possible: Now, the plugin provides only a whole block of html code (either button or link with stuff around), but providing the pure url (maybe via another function like html_new_page_url) would be more flexible for integration.
Best, Nøk (@2014-03-12)