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
Next revision
Previous revision
plugin:addnewpage [2018-04-24 09:52] – [Add New Page Plugin] Greebo compatibility dregadplugin:addnewpage [2024-02-15 21:47] (current) Aleksandr
Line 3: Line 3:
 ---- plugin ---- ---- plugin ----
 description: Put ‘add new page’ forms within pages, with optional namespace selection description: Put ‘add new page’ forms within pages, with optional namespace selection
-author     : Benjamin Santalucia, Sam Wilson, Michael Braun, Gerrit Uitslag, Albert Chern. +author     : Damien Regad, Benjamin Santalucia, Sam Wilson and other contributors 
-email      : +email      : dregad@mantisbt.org
 type       : syntax type       : syntax
-lastupdate : 2015-11-02 +lastupdate : 2023-05-10 
-compatible : Greebo"Frusterick Manners""Elenor of Tsort"DetritusHrunPonder StibbonsAdora BelleAnguaRincewind+compatible : RincewindAngua, Adora Belle, Ponder Stibbons, Hrun, Detritus, Elenor of Tsort, Frusterick MannersGreeboHogfatherIgorJack JackrumKaos
 depends    :  depends    : 
 conflicts  conflicts 
 similar    : new_page_dialog, npd, catlist similar    : new_page_dialog, npd, catlist
 tags       : button, form, create tags       : button, form, create
-screenshot_img: :plugin:addnewpage_ns_nothidden.png 
-downloadurl: https://github.com/samwilson/dokuwiki-plugin-addnewpage/archive/master.zip 
-bugtracker : https://github.com/samwilson/dokuwiki-plugin-addnewpage/issues 
-sourcerepo : https://github.com/samwilson/dokuwiki-plugin-addnewpage/ 
  
 +downloadurl: https://github.com/dregad/dokuwiki-plugin-addnewpage/zipball/master
 +bugtracker : https://github.com/dregad/dokuwiki-plugin-addnewpage/issues
 +sourcerepo : https://github.com/dregad/dokuwiki-plugin-addnewpage
 +donationurl: https://github.com/sponsors/dregad
 +
 +screenshot_img: :plugin:addnewpage_ns_nothidden.png
 ---- ----
  
 ===== Installation ===== ===== Installation =====
  
-Install the plugin through the [[plugin:extension|Extension Manager]] or [[plugin:plugin|Plugin Manager]] using the download URL above, which points to latest version of the plugin. Refer to [[:plugin_installation_instructions|plugin installation instructions]].+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Description ===== ===== Description =====
Line 27: Line 29:
 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). 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 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]]. Only namespaces to which the user is permitted to write are shown
 + 
 +The plugin can pair with the [[plugin:newpagetemplate|newpagetemplate Plugin]] to start with a predefined template instead of an empty page.
  
 The form submit button is disabled if there is no text in the title field. The form submit button is disabled if there is no text in the title field.
Line 42: Line 46:
 | {{http://i.imgur.com/gQ6yl0Y.png }} | Parent namespaces are greyed-out where the user has no access to add pages. | | {{http://i.imgur.com/gQ6yl0Y.png }} | Parent namespaces are greyed-out where the user has no access to add pages. |
  
- 
-==== Sites using this plugin ==== 
- 
- 
-===== Installation ===== 
- 
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above. Refer to [[:Plugins]] on how to install plugins manually. 
  
 ===== Syntax ===== ===== Syntax =====
Line 66: Line 63:
 This is configured in the main wiki configuration manager. 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). 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).
 +
 +==== Creating a namespace ====
 +
 +It is possible to use the ''@INPUT@'' placeholder to reference the user's input in the namespace specification. For example,
 +
 +  {{NEWPAGE>foo:@INPUT@:start}}
 +
 +will create a new namespace within the //foo// namespace. 
 +
 +
 +==== Date/time-based naming ====
 +
 +The plugin supports usage of [[https://www.php.net/manual/en/function.strftime.php|strftime placeholders]] in the namespace config. This allows adding date elements to the namespace specification
 +
 +  {{NEWPAGE>project:notes:@INPUT@_%Y-%m-%d}}
 +  {{NEWPAGE>reports:%Y:week_%W}}
 +
 +When used together with the [[#configuration_and_settings|autopage]] option to hide the input field, a daily page can be created with a single button click: 
 +
 +  {{NEWPAGE>journal:%Y-%m-%d?autopage}}
 +
 +==== Configuration overrides ====
 +
 +It is possible to override the plugin's [[#configuration_and_settings|configuration]] for a single usage of the syntax, by specifying a ''?'' followed by the config's name with an optional ''no'' prefix to negate it. Values for non-boolean configs can be provided with ''='', separated by '';''. Multiple overrides can be given, separated by '','' or ''&''
 +
 +General syntax:
 +
 +  ?[no]<option_1>[=value_1[;value_2]...][,[no]<option_2>]...
 +
 +Examples:
 +
 +  * overwrite the default hide setting <code>
 +{{NEWPAGE>namespace?nohide}}
 +</code>
 +  * custom namespace exclusion and hide root <code>
 +{{NEWPAGE>namespace?exclude=project;reports&noshowroot}}
 +</code>
  
 ==== New-page templates ==== ==== 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:+This plugin is also compatible with the [[:plugin:newpagetemplate|newpagetemplate 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#newtpl}}%%'' | Use the ''newtpl'' template |
Line 97: Line 131:
 You can configure the plugin in the Config Manager of DokuWiki. There are four 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''+  - **Excluded namespaces** (''exclude''— 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. +  - **Show root namespace** (''showroot''— 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 namespace selection** (''hide''— 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)..+  - **Hide "access denied" message** (''hideACL''— 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). 
 +  - **Hide the input box** (''autopage'') — The preconfigured namespace is treated as a full page IDUse with [[#date_time-based_naming|date placeholders]]). Default: false. 
 + 
  
 =====FAQ===== =====FAQ=====
-===Addnewpage form on the admin page?===+ 
 +=== Why is a privileged user not allowed to add pages? === 
 + 
 +Logged in as administrator, why do I get a //You are not allowed to add pages// error message ? 
 + 
 +> This is a [[https://github.com/dregad/dokuwiki-plugin-addnewpage/issues/38|known problem]], caused by caching. As a workaround, add ''%%~~NOCACHE~~%%'' to the page that contains the form. 
 + 
 + 
 +=== 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? 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''' > 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?===+=== More than one form per page? ===
  
 Is it possible to have more than one new-page form on a 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.+> 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...)===+=== 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? ===
  
-===How can a add_page form add in the site template automaticaly?Where to place the php statements?=== 
 ===== Development ===== ===== 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====+==== Issues and feature requests ====
  
-The ten most recent changes: +Please report all bugs and feature requests through the  
-{{rss>https://github.com/samwilson/dokuwiki-plugin-addnewpage/commits/master.atom date author}}+[[https://github.com/dregad/dokuwiki-plugin-addnewpage/issues|issue-tracking system on Github]].
  
-A full list can be [[https://github.com/samwilson/dokuwiki-plugin-addnewpage/commits|found on Github]].+Items of general interest should be added to the [[#faq|FAQ above]].
  
-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:+==== Releases ==== 
 + 
 +{{rss>https://github.com/dregad/dokuwiki-plugin-addnewpage/releases.atom 5}} 
 + 
 +The complete [[https://github.com/dregad/dokuwiki-plugin-addnewpage/releases|list of releases and change log]] is available on Github. 
 + 
 + 
 +=== Recent commits === 
 + 
 +{{rss>https://github.com/dregad/dokuwiki-plugin-addnewpage/commits/master.atom 5 author date}} 
 + 
 +Full [[https://github.com/dregad/dokuwiki-plugin-addnewpage/commits/master|Git log]]. 
 + 
 + 
 +==== Legacy releases ==== 
 + 
 +=== Before development 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   * 2008-01-10: New zip file with some correction (the submit bug in IE, the namespace ".") and all new language are added
Line 141: Line 200:
   * 2006-12-20: New Release, old version [used to be] at ''plugin:addnewpage_old''   * 2006-12-20: New Release, old version [used to be] at ''plugin:addnewpage_old''
  
-And from when this plugin was ''addnewpage_old'':+=== When this plugin was 'addnewpage_old' ===
  
   * 2006-11-14: Fixed: bug with new dokuwiki version.  Added italian language file.   * 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-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);   * 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);
 +
 +
 +===== History / Credits =====
 +
 +The plugin was [[plugin:addnewpage_old?rev=1366805333|originally written]] by Benjamin Santalucia (aka iDo) in 2006.
 +It was forked after the 2009-02-14 release of Dokuwiki, and moved to GitHub by [[https://github.com/hamstar|Robert McLeod]] in 2012.
 +Refer to the [[#legacy_releases|Legacy Releases]] section for details on what happened in those early, pre-GitHub years.
 +
 +In 2013, [[https://github.com/samwilson|Sam Wilson]] picked up the plugin's maintenance and actively supported it until he stopped using DokuWiki at the end of 2016. During this time, he merged several improvements and fixes contributed by these fine people:
 +
 +  * Michael Braun
 +  * Róbert Toth (FurloSK)
 +  * Gerrit Uitslag ([[user>Klap-in]]) added support for [[plugin:newpagetemplate]] plugin in 2014
 +  * Albert Chern, disabling of restricted parent namespaces in 2015
 +
 +In May 2023, Damien Regad decided to take over the plugin's maintenance.
 +
 +Thanks to [[https://github.com/dregad/dokuwiki-plugin-addnewpage/graphs/contributors|all the people who contributed]] to this plugin over the years.
 +
  
  
plugin/addnewpage.1524556368.txt.gz · Last modified: 2018-04-24 09:52 by dregad

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki