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
Last revisionBoth sides next revision
plugin:addnewpage [2023-09-25 00:14] – [Description] dregadplugin:addnewpage [2024-02-15 20:30] – Works in version Kaos johng
Line 7: Line 7:
 type       : syntax type       : syntax
 lastupdate : 2023-05-10 lastupdate : 2023-05-10
-compatible : Jack Jackrum+, Igor, Hogfather, Greebo, Frusterick Manners, Elenor of Tsort, Detritus, Hrun, Ponder Stibbons, Adora Belle, Angua, Rincewind+compatible : Kaos, Jack Jackrum+, Igor, Hogfather, Greebo, Frusterick Manners, Elenor of Tsort, Detritus, Hrun, Ponder Stibbons, Adora Belle, Angua, Rincewind
 depends    :  depends    : 
 conflicts  conflicts 
Line 16: Line 16:
 bugtracker : https://github.com/dregad/dokuwiki-plugin-addnewpage/issues bugtracker : https://github.com/dregad/dokuwiki-plugin-addnewpage/issues
 sourcerepo : https://github.com/dregad/dokuwiki-plugin-addnewpage sourcerepo : https://github.com/dregad/dokuwiki-plugin-addnewpage
 +donationurl: https://github.com/sponsors/dregad
 +
 ---- ----
  
Line 60: Line 62:
 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 94: Line 133:
   - **Show root namespace** (''showroot'') — 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'') — 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** (''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 "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=====
 +
 +=== 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? === === Addnewpage form on the admin page? ===
plugin/addnewpage.txt · Last modified: 2024-02-15 21:47 by Aleksandr

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