This seems to be the simpliest patch available for the problem - see http://ontoworld.org/wiki/Template:Asktest and http://sourceforge.net/mailarchive/forum.php?thread_name=470FA7EA.8000606%40ljudmila.org&forum_name=semediawiki-devel

I wonder which solution is the best for SMW?

         Sergey


The only addition I need there is the following patch:

--- a/SMW_QP_Template.php
+++ b/SMW_QP_Template.php
@@ -25,6 +25,7 @@ class SMWTemplateResultPrinter extends SMWResultPrinter {
       }

       public function getHTML($res) {
+               global $wgParser;
               // handle factbox
               global $smwgStoreActive, $wgTitle;

@@ -41,6 +42,8 @@ class SMWTemplateResultPrinter extends SMWResultPrinter {
               $parser_options = new ParserOptions();
               $parser_options->setEditSection(false);  // embedded sections should not have edit links
               $parser = new Parser();
+               $parser->mFunctionHooks = $wgParser->mFunctionHooks;
+               $parser->mFunctionSynonyms = $wgParser->mFunctionSynonyms;
               while ( $row = $res->getNext() ) {
                       $wikitext = '';
                       $firstcol = true;

It copies the parser functions from the main parser, so they can be used
in the templates given to <ask>. Maybe this can be added to SMW.

Regards,
Thomas