Last modified: 2011-03-13 18:06:52 UTC
when including a template into an Semantic Link like [[Property::{{Template}}]] there is some Problem with the [[SMW:Off]] used in SMW_QP_Template.php when changing $parserinput .= '[[SMW::off]]{{' . $this->m_template . $wikitext . '}}[[SMW::on]]'; to $parserinput .= '{{' . $this->m_template . $wikitext . '}}'; it works fine
sry i have not seen that this makes somehow strang effects on Categories, I think this is a very big Problem, maybe there should be a different Handling for templates an Parser Funktions with {{#
This Constelation creates strang effects --Template 1-- <includeonly>[[Bevölkerungsdichte::{{#ask:[[{{PAGENAME}}]]|?Einwohnerzahl|?Fläche|format=template|template=SMW-Bevölkerungsdichte|link=none}}Einwohner pro km²]]--></includeonly><noinclude>{{Dokumentation}}</noinclude> --Template 2-- <includeonly>{{formatnum:{{#expr:{{#replace:{{{1}}}|.|}}div{{#sub:{{#replace:{{{2}}}|.|}}|0|-9}} round 2}}}}</includeonly> <noinclude>{{Dokumentation}}</noinclude>
You try to reuse the output of an #ask that uses a template as the value for further parser functions/annotations. This is not supported. Note that the old <ask> did not support this at all, while it now works for all non-templaet outputs of #ask. Therefore this is not a critical bug, but rather a feature request to somehow enable reuse of templated outputs in annotations. The reason for using the internal [[SMW::on]] and [[SMW:off]] (no user-space features -- might vanish in the future!) is to prevent #ask results that embed other pages' contents to annotate the page they appear on. One could probably solve this in another way, but I have no good idea yet. Looking at your example, you could use two separate queries with "mainlabel=-" and "limit=1" to retrieve both numbers individually. Then the results need no template and you can use the parser function as desired.
Re-assign to extension developer for triage/comments.
I still believe my previous reply pretty much solves this to the extent that I can solve it at all. Since there were no further comments, I close this bug as WONTFIX now.