Quokkawiki: Customization

Last modification: 2008/07/20 23:55

Developers Guide

There are several easy customization points for QuokkaWiki if you want to modify its behavior:

  • Locale - extra language support is as easy as 1-2-3:

  1. Copy the en-US/ folder and rename the new folder to match the new locale, eg. 'fr-FR' for French.
  2. Modify each of the files, keeping the same keys and localizing the values.
  3. Change the 'lang' and 'locale' options in conf/prefs.module to match the new locale.
  • Custom tag support

  1. Create a .module file and add it to the modules/ directory (any .module file which does not start with an underscore (_) will be automatically loaded at start up).
  2. Define a PHP function named content_tag_abc (defines the 'abc' tag) using this template:

  function content_tag_abc($type, $args, $content, $class, $id) {
    switch ($type) {
      case TAG_CONTROL:    // [!abc ...]
      case TAG_ASSERT:     // [@abc ...]
      case TAG_VALUE:      // [=abc ...]
      case TAG_LAYOUT:     // [.abc ...]
        $output .= "<div".($class ? " class='$class'" : '').($id ? " id='$id'" : "").">".$content."</div>";
        return $output;
        return "";
  • Custom processing engines

  1. Create a new engine file using one of the engines in rules/ as a template.
  2. To change the default engine, modify conf/prefs.module and add an option for 'engines_default' (see modules/_config.module for an example).
  3. To override the engine for a specific page, simply add the following at the top of the page:

  [@engine new_engine_name]