On 11/09/2007, Steve Sanbeg ssanbeg@ask.com wrote:
I don't know if you can parse a constant string, so I wouldn't be surprised if the parser complains somewhere that it's not an object. I'd do something like:
$outputtext = "<categorytree depth="2" onlyroot="on" mode="all" style="float:none; margin-left:1ex; border:1px solid gray; padding:0.7ex; background-color:white;">My Category</categorytree>")
$outputtext = $parser->recursiveTagParse($outputtext);
I tried that, but no difference.
Assuming that the third arg to your hook is called $parser; probably neater to use the one that's passed in. But keeping your text in a variable and then replacing it is more consistent with most of what I've seen.
I am using a hook extension (http://www.mediawiki.org/wiki/Manual:Hooks), so I don't have a parser passed in as an argument.