I was excited to leverage the template facility to map a complex process using the graphviz (http://www.mediawiki.org/wiki/Extension:GraphViz) extension, which would then be included as a template on each page created for a node in the process, then use {{SUBPAGENAMEE}} in the template to automatically highlight where in the process graph this page documents, a sort of "You are here".
But alas, it appears that parameters (e.g. {{SUBPAGENAME}}), Templates, and ParserFunctions ({{#ifeq:...}}) are not interpreted within the <graphviz> tags. I get a graphviz nodes named, literally, "Test", "ifeq", and "SUBPAGENAMEE", using:
<graphviz> digraph g { Test {{ #ifeq: {{SUBPAGENAMEE}} | Test | [color="yellow"] }}; } </graphviz>
Is there a way to get the template/extentions parser to mangle the graphviz content before graphviz sees it? Is there an easier way to achieve the goal above? I don't mind modifying the extension scripts, or mediawiki, but with otherwise no experience in the code base, anyone who could even point me in the right direction would be helpful.
Using templates within extension tags is next-to-impossible due to the order of operations during a page parse. If you want to be able to use template parameters, you should implement a Parser Function [1]. Good luck!
[1] http://www.mediawiki.org/wiki/Manual:Parser_functions
-- Jim R. Wilson (jimbojw)
On Mon, Apr 28, 2008 at 12:09 PM, Paul Wehr sf_mediawiki@informationsoftworks.com wrote:
I was excited to leverage the template facility to map a complex process using the graphviz (http://www.mediawiki.org/wiki/Extension:GraphViz) extension, which would then be included as a template on each page created for a node in the process, then use {{SUBPAGENAMEE}} in the template to automatically highlight where in the process graph this page documents, a sort of "You are here".
But alas, it appears that parameters (e.g. {{SUBPAGENAME}}), Templates, and ParserFunctions ({{#ifeq:...}}) are not interpreted within the <graphviz> tags. I get a graphviz nodes named, literally, "Test", "ifeq", and "SUBPAGENAMEE", using:
<graphviz> digraph g { Test {{ #ifeq: {{SUBPAGENAMEE}} | Test | [color="yellow"] }}; } </graphviz>
Is there a way to get the template/extentions parser to mangle the graphviz content before graphviz sees it? Is there an easier way to achieve the goal above? I don't mind modifying the extension scripts, or mediawiki, but with otherwise no experience in the code base, anyone who could even point me in the right direction would be helpful.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Well, it's true you can't embed a template inside a tag:
<foobar arg="blat">{{my template}}</foobar>
but you can work around it with the #tag parser function that converts tags into parser functions:
{{#tag:foobar | {{my template}} | arg=blat }}
which will do what you want....
DanB
-----Original Message----- Jim R. Wilson wrote:
Using templates within extension tags is next-to-impossible due to the order of operations during a page parse. If you want to be able to use template parameters, you should implement a Parser Function...
Do you have this extension working with mekiawiki 1.12 by any chance? Also what version of Graphviz do you have? All of the install directions are for versions long ago. Matt
Paul Wehr wrote:
I was excited to leverage the template facility to map a complex process using the graphviz (http://www.mediawiki.org/wiki/Extension:GraphViz) extension, which would then be included as a template on each page created for a node in the process, then use {{SUBPAGENAMEE}} in the template to automatically highlight where in the process graph this page documents, a sort of "You are here".
But alas, it appears that parameters (e.g. {{SUBPAGENAME}}), Templates, and ParserFunctions ({{#ifeq:...}}) are not interpreted within the <graphviz> tags. I get a graphviz nodes named, literally, "Test", "ifeq", and "SUBPAGENAMEE", using:
<graphviz> digraph g { Test {{ #ifeq: {{SUBPAGENAMEE}} | Test | [color="yellow"] }}; } </graphviz>
Is there a way to get the template/extentions parser to mangle the graphviz content before graphviz sees it? Is there an easier way to achieve the goal above? I don't mind modifying the extension scripts, or mediawiki, but with otherwise no experience in the code base, anyone who could even point me in the right direction would be helpful.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Paul Wehr wrote:
Is there a way to get the template/extentions parser to mangle the graphviz content before graphviz sees it? Is there an easier way to achieve the goal above? I don't mind modifying the extension scripts, or mediawiki, but with otherwise no experience in the code base, anyone who could even point me in the right direction would be helpful.
You'd need to add a parse() call to the parser inside the graphviz extension code
mediawiki-l@lists.wikimedia.org