DokuWiki

It's better when it's simple

User Tools

Site Tools


namespace_templates

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
namespace_templates [2020-06-08 09:55] – [Table] add @!CURNS@,@!!CURNS@ and @!CURNS!@ Klap-innamespace_templates [2024-05-03 09:02] (current) – [Template files] differentiated zweihorn
Line 9: Line 9:
 Two kinds of template files can be used: Two kinds of template files can be used:
  
-  * ''_template.txt'', which are used in the current namespace. +  * ''_template.txt'', which will be used in the current namespace (but not below)
-  * ''%%__%%template.txt'' (two leading underscores), which work as the normal ''_template.txt'' files apart from the fact they are used in all namespaces below as well (they are inherited).+  * ''%%__%%template.txt'' (note the two leading underscores), will cover the current namespace and all namespaces below as well (thus this kind of template will be inherited).
  
-If both (inherited and normal) templates are present in namespace, the normal one is taken.+If both (normal and inherited) templates are present in the same namespace, the normal ''_template.txt'' will take precedence when a new page is created. This allows the pages of the top namespace to be differentiated from all pages of any sub-namespaces inherited below, which could become quite handy.
  
-One way to create the template file is to+**NOTE:** Any changes to a.m. template files will //only effect newly created pages// and existing pages are always left untouched. 
 + 
 +One way to create the template file is to:
  
   - use the wiki to save a page with the content that you want to use as a template into the appropriate namespace   - use the wiki to save a page with the content that you want to use as a template into the appropriate namespace
-  - use FTP or WebDAV to rename it as _template.txt, then +  - use FTP or WebDAV to rename it as _template.txt
-  - Note: ((These changes only apply to new pages that you create in the namespace.))+
  
 +However, one should prefer the [[plugin:TemplatePagename]] Plugin if possible (see explanations below).
 ===== Syntax ===== ===== Syntax =====
 The content of the file is just standard [[wiki:syntax|wiki markup]]. The content of the file is just standard [[wiki:syntax|wiki markup]].
Line 94: Line 96:
   * [[plugin:Headerfooter]] Plugin adds header text or footer text to pages only when they are displayed.   * [[plugin:Headerfooter]] Plugin adds header text or footer text to pages only when they are displayed.
  
 +==== Troubleshooting ====
 +
 +Problem: An unexpected error occurs "no timestamp" when server (Linux Ubuntu) cannot write the directory ''/dokuwiki/data/pages/namespace''. This might happen, when the namespace directory is created by the admin as ''<root>'' in order to put the namespace template file in ''/dokuwiki/data/pages/namespace/'', before creating the first page.
 +
 +1. Solution: Before establishing the hidden template file, first create a dummy page via the DokuWiki GUI, like so: ''yourserver/doku.php?id=namespace:dummy&do=edit''. This allows DokuWiki to create the namespace directory under own control and assures full write permissions for DokuWiki on the created directory.
  
 +2. Solution: The admin ''<root>'' should be able to change //owner and group// settings through the [[https://askubuntu.com/a/6727|chown command]] (e.g., ''chown www-data:www-data /dokuwiki/data/pages/namespace/'' on CLI) and in the first place should establish new directories and files with ''owner:group'' settings applicable to the DokuWiki installation anyway.
namespace_templates.1591602958.txt.gz · Last modified: 2020-06-08 09:55 by Klap-in

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