namespace_templates
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
namespace_templates [2012-12-06 15:14] – [Replacement patterns] Klap-in | namespace_templates [2024-05-03 08:39] – [Troubleshooting] 2. Solution zweihorn | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Namespace Templates ====== | ====== Namespace Templates ====== | ||
- | Sometime | + | Dokuwiki supports scaffolding. Sometimes |
- | When a page is created, [[DokuWiki]] looks up whether a template | + | When a page is created, [[DokuWiki]] looks up whether a template |
===== Template files ===== | ===== Template files ===== | ||
- | Two kinds of template files can be used : | + | |
+ | Two kinds of template files can be used: | ||
* '' | * '' | ||
* '' | * '' | ||
- | One way to create the template file is to | + | If both (inherited and normal) templates are present in a namespace, the normal one is used, when a new page is created. |
+ | **Note:** Any changes to your template files will only take effect for new pages you create in that namespace. | ||
+ | |||
+ | One way to create the template file is to: | ||
- | | + | |
- | | + | |
- | * use the wiki to delete the original page.((These changes only apply to new pages that you create in the namespace.)) | + | |
===== Syntax ===== | ===== Syntax ===== | ||
Line 23: | 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> | ||
- | ===== Editing templates ===== | ||
- | You can't edit the '' | + | ===== Still editing templates via wiki===== |
- | * one involving setting up symbolic links once, | + | |
- | * one involving a code change | + | You can't edit the '' |
- | * or the easiest is using a plugin | + | * the easiest is using the [[plugin: |
+ | * or by setting up through symbolic links | ||
==== Editable templates through symbolic links ==== | ==== Editable templates through symbolic links ==== | ||
+ | //**NOTE: This section contains instructions for use on a Linux server and will not work on a Windows system.**// | ||
- | This way, you can store your templates in a special namespace. By making a symlink | + | This way, you can store your templates in a special namespace, and make symlinks for DokuWiki |
- Create a namespace called " | - Create a namespace called " | ||
- | - In this namespace, create a page for each [[: | + | - In this namespace, create a page for each [[: |
- Follow the instructions given above, but make _template.txt a hard link ((soft links seem not to work, but see the note about FollowSymLinks below)) to the correct page under your templates namespace. | - Follow the instructions given above, but make _template.txt a hard link ((soft links seem not to work, but see the note about FollowSymLinks below)) to the correct page under your templates namespace. | ||
- | Another way is creating | + | Another way is to create |
cd / | cd / | ||
ln -s _template.txt template.txt | ln -s _template.txt template.txt | ||
| | ||
- | For these softlinks | + | For these softlinks |
- | + | ||
- | ==== Editable templates | + | //**NOTE: This section contains instructions |
- | This way, all your templates will be editable by anybody | + | Open up command prompt (cmd.exe) on the server, and browse to the location you with there to be a template. Use the MKLINK command to create a symbolic link. |
- | | + | |
- | - Now any user with write access in the namespace can create a page called " | + | mklink |
- | * Note: This method has the advantage that new templates will immediately be recognized. This may not be the case with the other methods (adding files or symlinks manually into the DokuWiki folders). | + | |
+ | ===== Plugins ===== | ||
- | |||
- | ===== Plugins ===== | ||
Additional template features are implemented by plugins. | Additional template features are implemented by plugins. | ||
+ | |||
+ | * [[plugin: | ||
* [[plugin: | * [[plugin: | ||
Line 80: | Line 86: | ||
* '' | * '' | ||
* 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: | * [[plugin: | ||
- | Some of the plugins | + | * [[plugin: |
- | ==== @GROUPS@ support | + | ==== Troubleshooting |
- | It may be interesting to have support for the '' | + | |
- | <code unidiff> | + | Problem: An unexpected error occurs "no timestamp" |
- | Index: dokuwiki-2009-02-14/inc/ | + | |
- | =================================================================== | + | |
- | --- dokuwiki-2009-02-14.orig/inc/common.php | + | |
- | +++ dokuwiki-2009-02-14/inc/ | + | |
- | @@ -840,6 +840,7 @@ | + | |
- | '@USER@', | + | |
- | '@NAME@', | + | |
- | '@MAIL@', | + | |
- | + | + | |
- | '@DATE@', | + | |
- | ), | + | |
- | array( | + | |
- | @@ -855,6 +856,7 @@ | + | |
- | | + | |
- | | + | |
- | | + | |
- | + implode(" | + | |
- | | + | |
- | ), $tpl); | + | |
- | + | ||
- | </code> | + | 1. Solution: Before establishing the hidden template file, first create a dummy page via the DokuWiki GUI, like so: '' |
- | | + | 2. Solution: The admin ''< |
namespace_templates.txt · Last modified: 2024-05-03 09:02 by zweihorn