edit

Templates

Warning: this is all subject to change without notice, just because.

Entering templates:

  1. {{template:"HelloWorld", hello:"world"}}
  2. then go to template:HelloWorld
  3. create a javascript class that takes as an instantation argument a json object.
  4. create a prototype method of the class called ‘init’, this will be called on page load.


function HelloWorld(data) { this.id = data.guid; this.hello = data.hello; }
HelloWorld.prototype.init = function() { $(this.id).innerHTML = 'hello' + this.hello; }

Templates are rendered:

  1. Wikipage renderer parses the wikiPage for templates:
    • Wikipage renderer creates a holder span for the template, each is given a guid.
    • Wikipage renderer creates a stack of template data objects, modified to include their guid.
  2. On window load, run through the data collection and create template objects from the template data objects. A special keyword ‘template’ is used to create an eval string for what template object to create.



Default Templates

Beyond including templates, there are ‘built in templates’.

Data Templates

edit view source
cancel cancel

Claim this page. ( already registered? login and claim as existing user. )

This page is unclaimed. You can claim it for yourself and block others from editing

cancel - register as new user

Login.

Claim this page

Logout.