Subdirectories: NewFeatures.
2013-02-25
DWiki Global Variables
As TemplateSyntax discusses, one can use global variables in templates in several ways. However, it helps to know what global variables are available. Thus this incomplete listing.
First, all ConfigurationFile directives are available as global variables.
Then, during request processing DWiki internally defines a number of additional global variables:
pageThe current page's full path, in DWiki form. abspageThe current page's full path, including a ' /' at the start.pagenameThe page's name; its last path component. pagetypeThe type of the page, usually 'file' or 'dir'. view-formatThe current view being processed. relnameIn blog::blog, the name of the current page relative to the blog directory being displayed. basepageIn a VirtualDirectory context, the full path of the non-virtual directory. Otherwise the same as page.:wikitext:titleAfter a piece of wikitext has been rendered (more exactly after any wikitext template renderer has been used, including wikitext:cache), this is its title if any exists. The 'title' of a piece of wikitext is the text of the header that is at the start of the text, if there is one. This is the same as thewikitext:titletemplate renderer but may be more convenient to use.:wikitext:title:nohtmlThis is the title but without any HTML markup, making it useful for eg a <title>. It's the same as the :wikitext:title:nohtmltemplate renderer.loginThe currently authenticated user. comment-ipIP address that posted the current comment. comment-userUser that posted the current comment. :comment:postThe result of an attempt to post a comment. One of 'good', 'bad', 'badchar', or 'nocomment' (the latter if it was an attempt to post an empty comment). (Only defined during comment posting.) :error:errorError type. Only defined during error processing. http-commandThe type of HTTP command being processed, either GET or POST. http-versionThe (claimed) version of HTTP that the current request used. remote-ipThe IP address the current request came from. server-nameThe hostname or IP address for this web server that the sender of the current request claims to have used. Not all of these are defined all of the time. Generally a context-dependant variable is only defined when the current thing being processed has that sort of information.
There are other global variables that get set, but they are for more internal use, and you're best off browsing the source code for them.