namespace_templates
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
namespace_templates [2014-09-24 15:50] – test 92.211.162.78 | namespace_templates [2020-06-08 09:55] – [Table] add @!CURNS@,@!!CURNS@ and @!CURNS!@ Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Namespace Templates ====== | ====== Namespace Templates ====== | ||
- | Sometimes you might want to have every page in a certain namespace based on a common skeleton. For example, in the '' | + | Dokuwiki supports scaffolding. |
When a page is created, [[DokuWiki]] looks up whether a template file exists and it shows it within the editor window. The templates therefore are .txt files and should contain wiki markup. | When a page is created, [[DokuWiki]] looks up whether a template file exists and it shows it within the editor window. The templates therefore are .txt files and should contain wiki markup. | ||
===== Template files ===== | ===== Template files ===== | ||
+ | |||
Two kinds of template files can be used: | Two kinds of template files can be used: | ||
Line 15: | Line 16: | ||
One way to create the template file is to | One way to create the template file is to | ||
- | | + | |
- | | + | |
- | | + | |
===== Syntax ===== | ===== Syntax ===== | ||
Line 25: | Line 26: | ||
Inside of the file, you may also use some replacement patterns to make the template a little more dynamic. | Inside of the file, you may also use some replacement patterns to make the template a little more dynamic. | ||
- | ^ @ID@ | + | ^ @ID@ | full ID of the page | |
- | ^ @NS@ | + | ^ @NS@ | namespace of the page |
- | ^ @PAGE@ | + | ^ @CURNS@ |
- | ^ @!PAGE@ | + | ^ @!CURNS@ |
- | ^ @!!PAGE@ | same as above but with the first character of all words uppercased | + | ^ @!!CURNS@ |
- | ^ @!PAGE!@ | same as above but with all characters uppercased | + | ^ @!CURNS!@ |
- | ^ @FILE@ | + | ^ @PAGE@ |
- | ^ @!FILE@ | + | ^ @!PAGE@ |
- | ^ @!FILE!@ | same as above but with all characters uppercased | + | ^ @!!PAGE@ |
- | ^ @USER@ | + | ^ @!PAGE!@ |
- | ^ @NAME@ | + | ^ @FILE@ |
- | ^ @MAIL@ | + | ^ @!FILE@ |
- | ^ @DATE@ | + | ^ @!FILE!@ |
- | ^ %a %d-%m-%y etc. | e.g. Thu 06-12-12. [[phpfn>Strftime]] placeholders are replaced by page creation time | | + | ^ @USER@ |
- | ^ %% | + | ^ @NAME@ |
+ | ^ @MAIL@ | ||
+ | ^ @DATE@ | ||
+ | ^ %a %d-%m-%y etc. | e.g. Thu 06-12-12. [[phpfn>strftime]] placeholders are replaced by page creation time | | ||
+ | ^ %% | a literal '' | ||
- | In addition you may also use any [[phpfn> | ||
===== Still editing templates via wiki===== | ===== Still editing templates via wiki===== | ||
You can't edit the '' | You can't edit the '' | ||
- | * the easiest is using the [[plugin: | + | * the easiest is using the [[plugin: |
* or by setting up through symbolic links | * or by setting up through symbolic links | ||
Line 73: | Line 77: | ||
===== Plugins ===== | ===== Plugins ===== | ||
+ | |||
Additional template features are implemented by plugins. | Additional template features are implemented by plugins. | ||
- | * [[plugin: | + | * [[plugin: |
* [[plugin: | * [[plugin: | ||
* '' | * '' | ||
* '' | * '' | ||
- | * and variants for deeper namespaces too and some other templates e.g. for '' | + | * and variants for deeper namespaces too and some other templates e.g. for '' |
+ | All these plugins are only editable via the file system. | ||
- | * [[plugin: | + | * [[plugin: |
* [[plugin: | * [[plugin: | ||
Line 89: | Line 95: | ||
- | ===== @GROUPS@ support ===== | ||
- | |||
- | It may be interesting to have support for the '' | ||
- | |||
- | <code unidiff> | ||
- | Index: dokuwiki-2009-02-14/ | ||
- | =================================================================== | ||
- | --- dokuwiki-2009-02-14.orig/ | ||
- | +++ dokuwiki-2009-02-14/ | ||
- | @@ -840,6 +840,7 @@ | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | + ' | ||
- | ' | ||
- | ), | ||
- | array( | ||
- | @@ -855,6 +856,7 @@ | ||
- | | ||
- | | ||
- | | ||
- | + implode(" | ||
- | | ||
- | ), $tpl); | ||
- | |||
- | |||
- | </ | ||
- | |||
- | --- // |
namespace_templates.txt · Last modified: 2023-08-24 11:25 by 212.201.117.6