[SMW-devel] parse SMW-properties inside tag function
Hi everyone! So I have the following string: [[propname::foo]],[[propname2::bar]]] I want to turn it into HTML a tags. I'm now sitting inside parser hook and struggling with recursiveTagParse() and parse() functions but without an efect: ... $parser-setHook( 'backlinktags', 'WikivoteBacklinkTags::addGetParameters' ); ... static public function addGetParameters($input, array $args, Parser $parser, PPFrame $frame) { $str = [[propname::foo]],[[propname2::bar]]]; $output = recursiveTagParse($str, $frame); // $output=, and that's bad } Any ideas on how to parse my string into html? - Yury Katkov, WikiVote -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
Re: [SMW-devel] parse SMW-properties inside tag function
I figured it out myself. For correct work, parse() should be used. If you want to use your tag in templates, don't forget to add replaceVariables: static public function addGetParameters($input, array $args, Parser $parser, PPFrame $frame) { if (!isset($args['property'])) return $input; $input = $parser-replaceVariables($input,$frame); $parser1 = new Parser(); /** * @var ParserOutput */ $output = $parser1-parse($input, $frame-getTitle(), $parser-getOptions(), true, true, null); // the rest is the logic of my extension - Yury Katkov, WikiVote On Mon, Jul 1, 2013 at 10:49 AM, Yury Katkov katkov.ju...@gmail.com wrote: Hi everyone! So I have the following string: [[propname::foo]],[[propname2::bar]]] I want to turn it into HTML a tags. I'm now sitting inside parser hook and struggling with recursiveTagParse() and parse() functions but without an efect: ... $parser-setHook( 'backlinktags', 'WikivoteBacklinkTags::addGetParameters' ); ... static public function addGetParameters($input, array $args, Parser $parser, PPFrame $frame) { $str = [[propname::foo]],[[propname2::bar]]]; $output = recursiveTagParse($str, $frame); // $output=, and that's bad } Any ideas on how to parse my string into html? - Yury Katkov, WikiVote -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev ___ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
[SMW-devel] Wiki of the Month: July 2013 - OGD Cockpit
Hello Everyone, I am pleased to announce that the Semantic MediaWiki of the Month for July 2013 is the OGD Cockpit. http://semantic-mediawiki.org/wiki/OGD_Cockpit OGD Cockpit is meant to showcase the potential of Semantic MediaWiki that is used to support the collaborative effort of interactively putting together a data catalog inside the public administrations. Congratulations to the OGD Cockpit team for all of your hard work and thank you for sharing your wiki with us. As always, please do not forget to nominate your wiki. Just follow the instructions here: http://semantic-mediawiki.org/wiki/Wiki_of_the_Month#Nominate_a_wiki. Thanks, -Desi -- This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev___ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel