1====== Newpagefill Plugin ====== 2 3---- plugin ---- 4description: Page creation helper with prefill and @TITLE@ support 5author : Valentin LORTET 6email : contact@valentinlortet.fr 7type : Action 8lastupdate : 2026-03-13 9compatible : Librarian 10depends : 11conflicts : 12similar : 13tags : Page, Creation, Template, Namespace, JavaScript 14 15downloadurl: https://github.com/Lortet/dokuwiki-plugin-newpagefill/zipball/master 16bugtracker : https://github.com/Lortet/dokuwiki-plugin-newpagefill/issues 17sourcerepo : https://github.com/Lortet/dokuwiki-plugin-newpagefill/ 18donationurl: 19screenshot_img : 20---- 21 22[[fr:plugin:newpagefill| Français]] | **English** | [[de:plugin:newpagefill| Deutsch]] | [[es:plugin:newpagefill| Español]] 23 24===== Installation ===== 25 26Install the plugin from the [[plugin:extension|Extension Manager]]. 27 28===== Description ===== 29 30The **newpagefill** plugin adds a lightweight helper to create a new page: 31 * enter a title; 32 * automatically suggest a page ID; 33 * optionally enter the namespace; 34 * choose the creation mode depending on configuration; 35 * open the editor directly on the target page. 36 37It also complements the native DokuWiki template system: 38 * use ''_template.txt'' or ''%%__template.txt%%'' when available; 39 * add support for the ''@TITLE@'' placeholder in the injected content; 40 * fall back to a plugin-specific template when no native template exists. 41 42===== Settings ===== 43 44^ Name ^ Description ^ Default value ^ 45| template | Fallback template used when no native DokuWiki page template is found. | ''===== @TITLE@ ====='' | 46| default_start_mode | Default creation mode. | ''start'' | 47 48Possible values for ''default_start_mode'': 49 * ''ask'': show a selector in the dialog; 50 * ''start'': create a start page; 51 * ''none'': create a direct page; 52 * ''same'': create a subpage with the same name. 53 54===== Placeholders ===== 55 56The plugin template may contain: 57 * ''@TITLE@'': title computed by the plugin (specific to newpagefill); 58 * all native DokuWiki placeholders: ''@ID@'', ''@NS@'', ''@PAGE@'', ''@USER@'', ''@DATE@'', etc. (handled by DokuWiki core, not by this plugin). 59 60===== @TITLE@ behaviour ===== 61 62The value of ''@TITLE@'' is computed as follows: 63 * the request ''title'' value has priority; 64 * otherwise, the plugin tries to extract a title from the creation URL; 65 * if the created page is the namespace start page, the parent namespace name is used; 66 * ''_'' characters are replaced with spaces. 67 68===== Template compatibility ===== 69 70The plugin follows this order: 71 * template already provided by DokuWiki; 72 * ''_template.txt'' in the target folder; 73 * %%__template.txt%% in the current or parent namespace; 74 * fallback template configured in the plugin. 75 76===== JavaScript function ===== 77 78The plugin exposes the global function: 79 80<code javascript> 81window.NewPageFill.openCreatePageDialog(options) 82</code> 83 84Example: 85 86<code javascript> 87window.NewPageFill.openCreatePageDialog({ 88 namespace: 'wiki:documentation', 89 initialTitle: 'New page' 90}); 91</code> 92 93Useful options: 94 * ''namespace'': target DokuWiki namespace; 95 * ''initialTitle'': prefilled title; 96 * ''start'': 97 * ''undefined'' or ''null'': use the plugin configuration; 98 * ''@ask@'': force the mode choice dialog; 99 * ''true'': use the wiki start page; 100 * ''false'': create the page directly; 101 * ''@same@'': create a subpage with the same name as the page ID; 102 * any other string: create a subpage with that value; 103 * ''sepchar'': separator used to generate the page ID. 104 105If ''start'' is not provided and ''default_start_mode = ask'', the dialog offers: 106 * direct page; 107 * start page; 108 * subpage with the same name. 109