DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:addnewpage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Both sides next revision
plugin:addnewpage [2020-10-14 16:11]
khanh1123
plugin:addnewpage [2020-10-15 08:30] (current)
saggi old revision restored (2019-10-25 10:19)
Line 1: Line 1:
-====== LUONG HONG KHANH WIKI======+====== Add New Page Plugin ====== 
 + 
 +---- plugin ---- 
 +description: Put ‘add new page’ forms within pages, with optional namespace selection 
 +author     : Benjamin Santalucia, Sam Wilson, Michael Braun, Gerrit Uitslag, Albert Chern. 
 +email      :  
 +type       : syntax 
 +lastupdate : 2015-11-02 
 +compatible : Greebo, Frusterick Manners, Elenor of Tsort, Detritus, Hrun, Ponder Stibbons, Adora Belle, Angua, Rincewind 
 +depends    :  
 +conflicts  :  
 +similar    : new_page_dialog, npd, catlist 
 +tags       : button, form, create 
 +screenshot_img: :plugin:addnewpage_ns_nothidden.png 
 +downloadurl: https://github.com/samwilson/dokuwiki-plugin-addnewpage/zipball/master 
 +bugtracker : https://github.com/samwilson/dokuwiki-plugin-addnewpage/issues 
 +sourcerepo : https://github.com/samwilson/dokuwiki-plugin-addnewpage 
 + 
 +---- 
 + 
 +===== Installation ===== 
 + 
 +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. 
 + 
 +===== Description ===== 
 + 
 +This plugin allows you to add new-page forms to wiki pages, so that users can simply enter the title of a new page and go straight to the editing form (rather than first creating a link to the page, or typing the URL directly). 
 + 
 +The target namespace for the new page can either be selected from a drop-down list in the new-page form, or specified in the form [[#syntax|syntax]]. Only namespaces to which the user is permitted to write are shown. 
 + 
 +The form submit button is disabled if there is no text in the title field. 
 + 
 +===== Usage ===== 
 + 
 +Put ''%%{{NEWPAGE}}%%'' anywhere in a wiki page to get a new-page-title text entry box, and a namespace selection drop-down menu.  More details in the [[#Syntax]] section below. 
 + 
 +==== Screenshots ==== 
 + 
 +| {{:plugin:addnewpage_nooptions.png }}    | The default form has a drop-down with all namespaces of the wiki and a text field for the pagename. | 
 +| {{:plugin:addnewpage_ns_hidden.png }}    | ''%%{{NEWPAGE>test}}%%'' with configuration option "Hide namespace selection" enabled. | 
 +| {{:plugin:addnewpage_ns_nothidden.png }} | ''%%{{NEWPAGE>test}}%%'' with configuration option "Hide namespace selection" disabled. | 
 +| {{http://i.imgur.com/gQ6yl0Y.png }} | Parent namespaces are greyed-out where the user has no access to add pages. | 
 + 
 + 
 +==== Sites using this plugin ==== 
 + 
 + 
 + 
 +===== Syntax ===== 
 + 
 +==== Basic ==== 
 + 
 +The basic syntax is: 
 + 
 +  {{NEWPAGE}}  
 + 
 +Or, to specify a namespace: 
 + 
 +  {{NEWPAGE>namespace}} 
 + 
 +Where ''namespace'' is the target namespace for the new page. 
 +When this is specified, the namespace selection box can either be hidden (which it is by default) or set to show only sub-namespaces of the given one. 
 +This is configured in the main wiki configuration manager. 
 +If ''@PAGE@'' (or ''@NS@'') is given, the current page ID (or its namespace) will be used (e.g. for use in [[:namespace templates]]; see below). 
 + 
 +==== New-page templates ==== 
 + 
 +This plugin is also compatible with the [[:plugin:newpagetemplate|New Page Template]] plugin (note that this is a separate feature to the [[#namespace templates]] described below). To specify a template to be used with the new page, use one of the following syntaxes: 
 + 
 +| ''%%{{NEWPAGE#newtpl}}%%'' | Use the ''newtpl'' template | 
 +| ''%%{{NEWPAGE#newtpl1,newtpl2}}%%'' | Present a drop-down list of ''newtpl1'' and\\ ''newtpl2'', allowing the user to choose one | 
 +| ''%%{{NEWPAGE#newtpl1|Title One,newtpl2|Title Two}}%%'' | The same as above, but with nicer titles | 
 + 
 +In all of these, the basic ''>namespace'' syntax can be included before the hash ''#'' character. 
 + 
 +==== Multiple occurences ==== 
 + 
 +The ''%%{{NEWPAGE}}%%'' syntax may be added multiple times on the same page. 
 + 
 +==== Site templates ==== 
 + 
 +To include an add-new-page form in a [[:template|Site Template]], use the following line: 
 + 
 +<code php> 
 +<?php echo p_render('xhtml',p_get_instructions('{{NEWPAGE}}'),$info) ?>  
 +</code> 
 + 
 +==== Namespace Templates ==== 
 + 
 +Add-new-page forms can also be added to [[:Namespace Templates]].  The replacement patterns ''@ID@'' and ''@NS@'' can be used in the plugin's ''namespace'' parameter. 
 + 
 +===== Configuration and Settings ===== 
 + 
 +You can configure the plugin in the Config Manager of DokuWiki. There are four settings: 
 + 
 +  - **Excluded namespaces** — A semicolon-separated list of namespaces that should be excluded from the namespace selection list. Default: ''wiki;playground''
 +  - **Show root namespace** — Whether to show the wiki's root namespace in the namespace selection list. Default: true. 
 +  - **Hide namespace selection** — Hide the namespace selection list. Only applies if a namespace is given (see [[#syntax|above]]). Default: true. 
 +  - **Hide "access denied" message** — Do not show the "You are not allowed to add pages" message when the user doesn't have permission to create pages. Default: false (i.e. do show the message).. 
 + 
 +=====FAQ===== 
 +===Addnewpage form on the admin page?=== 
 +Is there a possibility to add the plugin as a part of the admin page, like the plugins pagemove or upgrade? 
 + 
 +> Not currently, but this can be done by modifying your template and including the addnewpage form only when ''$ACT=='admin''' 
 + 
 +===More than one form per page?=== 
 + 
 +Is it possible to have more than one new-page form on a page? 
 + 
 +>Yes. Nothing special needs to be done to permit this, just add the markup wherever you want the forms to appear. 
 + 
 +===Can the textbox be pre-populated with a value? Specifically, the ID variable? (Trying to have a user search for a page, then use this plugin to create the page if they don't find what they're looking for...)=== 
 + 
 +===How can a add_page form add in the site template automaticaly?Where to place the php statements?=== 
 +===== Development ===== 
 +====Issues and feature requests==== 
 +Please report all bugs and feature requests through the [[https://github.com/samwilson/dokuwiki-plugin-addnewpage/issues|issue-tracking system on Github]].  Items of general interest should be added to the [[#faq|FAQ above]]. 
 + 
 +====Changelog==== 
 + 
 +The ten most recent changes: 
 +{{rss>https://github.com/samwilson/dokuwiki-plugin-addnewpage/commits/master.atom date author}} 
 + 
 +A full list can be [[https://github.com/samwilson/dokuwiki-plugin-addnewpage/commits|found on Github]]. 
 + 
 +This plugin is based on the '//old addnewpage//' plugin, and forked from that one after the 2009-02-14 release of Dokuwiki. 
 + 
 +Changes from before development was moved to Github: 
 + 
 +  * 2008-01-10: New zip file with some correction (the submit bug in IE, the namespace ".") and all new language are added 
 +  * 2007-05-19: Portuguese language definitions added for completely hide NEWPAGE by GibaPhp 
 +  * 2007-01-21: Can configure if you want to add some message about rights or completely hide NEWPAGE 
 +  * 2007-01-21: Now support ACL (thanks to 66[dot]7[dot]118[dot]82) 
 +  * 2007-01-13: Add new functionality with the syntax <nowiki>{{NEWPAGE[>namespace]}}</nowiki> (thanks to Martin) 
 +  * 2007-01-12: Remove 4 invisible hex chars in script.js, adding Italian and Russian (incomplete) 
 +  * 2007-01-11: Fix encoding problem (with old noaccent function) 
 +  * 2006-12-20: New Release, old version [used to be] at ''plugin:addnewpage_old'' 
 + 
 +And from when this plugin was ''addnewpage_old'': 
 + 
 +  * 2006-11-14: Fixed: bug with new dokuwiki version.  Added italian language file. 
 +  * 2006-07-05: Fixed: Zip file is now ok.  Added: Russian language file. 
 +  * 2006-06-20 : Fixed: Problem with the empty select box, Added: Multilanguage Support; Root Namespace (see Kibi's comment); The selected line is now the same as the current namespace (see Kibi's comment);
  
-CREATED FOR CSCI322 
  
plugin/addnewpage.txt · Last modified: 2020-10-15 08:30 by saggi