Learn about DokuWiki
Learn about DokuWiki
Simply create a template file to use for your start pages. You can place an underscore before the name of the file so that it doesn't show up in the sitemap, but you will have to create the text file on the server manually (see Namespace Templates for more). Whenever a new namespace is created, a new start page for that namespace will be created as well. If you create a start page in a new namespace, the automatic one will be overwritten by yours. Generally this will be useful if you want your start pages to be navigational to other pages in the namespace (in which case, look at dir or pageindex to generate the content dynamically).
This functions a little differently from page templates, as it actually creates the page instead of autofilling the edit window when you go to create the page. Thus, the two features should be compatible.
Note that creating top-level pages doesn't call
IO_NAMESPACE_CREATED, even if no other pages exist. You'll have to make the top-level one by hand.
As of the most recent update, these pages are created by the user who created the first page in the namespace. If the user does not have permissions to create the start page, it will not be created. This can be overridden in the settings, but introduces a security risk.
|@ID@||full ID of the page|
|@NS@||namespace of the page|
|@PAGE@||page name (ID without namespace and underscores replaced by spaces)|
|@!PAGE@||same as above but with the first character uppercased|
|@!!PAGE@||same as above but with the first character of all words uppercased|
|@!PAGE!@||same as above but with all characters uppercased|
|@FILE@||page name (ID without namespace, underscores kept as is)|
|@!FILE@||same as above but with the first character uppercased|
|@!FILE!@||same as above but with all characters uppercased|
|@USER@||ID of user who is creating the page|
|@NAME@||name of user who is creating the page|
|@MAIL@||mail address of user who is creating the page|
|@DATE@||date and time when edit session started|
I've added a few more custom ones:
|@!NS@||namespace of the page (with spaces) but with the first character uppercased|
|@!!NS@||same as above but with the first character of all words uppercased|
|@!!NS!@||same as above but with all characters uppercased|
|@PARENT@||the name of the parent namespace. Blank if parent is top|
There are two configuration options:
templatefilepoints to the file to use as the template for new start pages.
silenthides alerts when the page is created. Uncheck for error messages if something is not working.
Registers as IO_NAMESPACE_CREATED.
At first: Thanks for your plugin It helped me a lot.
I've seen you have written, that we should trigger io_wikipage_write if we can.
How about setting your function “AFTER” IO_NAMESPACE_CREATED instead of “BEFORE”?
Then we could use the functionsaveWikiText($id, $wikitext, "autostartpage", $minor = false);
> which triggers that event…
Greetings — StefanL 2014/01/21 09:16Hi Stefan, thanks for the suggestion. I'm not sure why I didn't do that in the first place.
It's been fixed now, and the docs have been updated. Cheers, charlesjuliank 2015/01/02 11:27
On “frusterick manners”, you have to create 2 new namespaces for this plugin to work. But after that, it's fine — redge76 2018-01-15 09:53