welcome: please sign in

The following 212 words could not be found in the dictionary of 0 words and are highlighted below:
access   accessed   address   also   Anarcat   and   any   anywhere   appear   appropriate   are   areas   as   At   be   better   builtin   but   by   cached   can   code   com   comments   content   Contents   contribution   course   create   creating   Creation   Current   data   Date   date   Dated   define   Defining   Description   dict   Dict   dictionary   displays   Doe   does   domain   each   edit   email   enough   especially   etc   Every   exactly   Example   example   excluded   expand   expansion   extended   fancy   fetched   ffffcc   file   following   For   for   format   from   get   Get   Getting   global   happens   Help   helpful   his   home   how   if   If   in   In   including   instead   instructions   is   it   John   Just   like   lines   link   loaded   loginname   long   macro   Mail   mailto   markup   memory   might   more   must   My   name   Name   New   new   None   normal   not   Note   obfuscation   Of   of   On   on   once   one   opening   or   Other   other   page   Page   pages   parsing   pickle   Predefined   preview   process   processing   public   R1   R2   random   Raw   Refresh   render   Renders   replaced   require   rowbgcolor   running   saved   saving   Saving   set   Signature   signing   sites   some   space   special   stamp   start   sub   substituted   system   T06   Table   tells   template   Templates   templates   test   text   than   that   The   the   then   Then   these   they   think   This   Time   time   to   To   unreplaced   use   useful   User   user   username   using   Val   value   values   var1   var2   var3   variable   Variable   variables   Variables   very   When   when   whenever   wiki   Wiki   will   with   within   would   You   you   your  

Clear message
location: HelpOnVariables

Variables

This page tells you more how you can use variables in wiki pages. This is especially helpful within templates, but also on "normal" wiki pages (like for signing a contribution).

Predefined Variables

The following variables are substituted when a page is saved. Note that they will appear unreplaced in the preview!

Variable

Description

Examplemarkup

Examplerender

@PAGE@

Name of the page (useful for template pages)

HelpOnPageCreation

HelpOnPageCreation

@TIMESTAMP@

Raw time stamp

2004-08-30T06:38:05Z

2004-08-30T06:38:05Z

@DATE@

Current date in the system's format

<<Date(2004-08-30T06:38:05Z)>>

2004-08-30

@TIME@

Current date and time in the user's format

<<DateTime(2004-08-30T06:38:05Z)>>

2004-08-30 06:38:05

@ME@

Just the user's name

TheAnarcat

TheAnarcat

@USERNAME@

Just the user's name (or his domain/IP)

TheAnarcat

TheAnarcat

@USER@

Signature "-- loginname"

-- TheAnarcat

-- TheAnarcat

@SIG@

Dated Signature "-- loginname date time"

-- TheAnarcat <<DateTime(2004-08-30T06:38:05Z)>>

-- TheAnarcat 2004-08-30 06:38:05

@EMAIL@

<<MailTo()>> Just the user's email address, obfuscation can be extended

e.g. test DOT user AT example DOT com

@MAILTO@

A fancy mailto: link with the user's data

Noneon public sites, better use the MailTo macro

Defining New Variables

If the builtin variables are not enough, you can define new variables by creating a sub-page of your home page with a dictionary of variables in it. For example, if your username is JohnDoe, you would create page JohnDoe/MyDict with the content like:

 VAR1:: some random text
 VAR2:: use ''any'' wiki markup

Then, whenever you edit a page, you can use @VAR1@ or @VAR2 to expand to the text in that dictionary. (Note that the lines in a dictionary must start with exactly one space.)

Getting Variables

At Every Page Refresh

You can use these values using the GetVal macro:

<<GetVal(WikiDict,var1)>> <<GetVal(WikiDict,var2)>> <<GetVal(WikiDict,var3)>>

Renders as:

When Saving the Page

If the variables are set on UserName/MyDict (UserName must of course be replaced as appropriate), you can get the variables when saving any page with @var1@, @var2@, ...etc. instead of the GetVal macro.


/!\ Note that data in dict pages is cached and does not require opening and parsing the page file for each access to the value. In CGI, the value is fetched from a pickle, in long running process, the pickle is loaded once and then the value is accessed from memory.

/!\ Note that saving template pages and using preview does not expand variables. Other than that, variable expansion is very global and happens anywhere on the page, including code displays, comments, processing instructions and other "special" areas of a page you might think are excluded.