From: Yaron K. <ya...@wi...> - 2014-03-26 16:19:14
|
Hi Samuel, Well, to be fair, tag functions can be defined to have their contents parsed first, as of MediaWiki 1.16 or so - it's just not commonly done. I'm also surprised that that was the issue with the original example you listed: {{#set={{#tag:geneidconv|{{PAGENAMEE}}|to=EntrezGene}}}} I thought that #tag was useful specifically to get around that (former) limitation, by turning tag functions into parser functions. I guess maybe it's less useful than I thought. Anyway, it's good to hear that you solved this problem. -Yaron On Tue, Mar 25, 2014 at 7:24 PM, Samuel Lampa <sam...@gm...>wrote: > Hi Yaron and others, > > I finally found the solution now to this old problem of mine! > > It turns "Tag extensions" [1] don't work together with "parsy" stuff like > templates and semantic facts, and that one should create a "Parser function > extension" [2] instead! :-o > > So, after I did this, in the following commit, it works!: > https://github.com/samuell/GeneIdConvert/commit/ > b681cab79993648a06e940dca4961d688727a809 > > [1] http://www.mediawiki.org/wiki/Manual:Tag_extensions > [2] http://www.mediawiki.org/wiki/Manual:Parser_functions > > Cheers > > // Samuel > > > On 2013-11-28 21:09, Yaron Koren wrote: > >> Hi Samuel, >> >> Are you sure that that parser function only outputs a string? I would try >> calling it with text around it, like "A{{#your tag here}}B" or something, >> then looking at the resulting HTML source, to see if perhaps there are >> newlines, <p> tags or the like being placed as well. If there are, this may >> help (though I don't know if it can work for the combination of tag >> functions + #tag): >> >> http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_ >> from_a_MediaWiki_Parser_Function >> >> -Yaron >> >> >> On Thu, Nov 28, 2013 at 2:31 PM, Samuel Lampa <sam...@gm...<mailto: >> sam...@gm...>> wrote: >> >> Hi, >> >> I got problems with a value that SMW tells "is not properly >> understood", >> or more exactly: "The given value was not understood", in a balloon. >> >> It looks like this: >> https://lh5.googleusercontent.com/-x-Q9tEGMPaM/UpeWH9UyyjI/ >> AAAAAAAACyc/HD07aURLOGs/w853-h601-no/HNSCC_problem.png >> >> As can be seen in the screenshot, the value is properly shown when >> used >> in normal wiki text (and echo:ed from PHP), but just fails to be >> recognized as an SMW fact. >> >> >> The code that sets this fact, is: >> >> [[Entrez ID::{{#tag:geneidconv|{{PAGENAMEE}}|to=EntrezGene}}]] >> >> I have tried also with: >> >> {{#set={{#tag:geneidconv|{{PAGENAMEE}}|to=EntrezGene}}}} >> >> ... with the same result. >> >> The code for the geneidconv parser tag, is on line 52 at: >> https://github.com/samuell/GeneIdConvert/blob/master/ >> GeneIdConvert.php#L52 >> >> ... that is, it just returns a normal string, which in this case >> happens >> to be a number. >> >> I have tried adding a (string) cast to the return statement of >> wfGeneIdConvRender() too, to no avail. >> >> The "Property:Entrez ID" page, just contains: >> >> This is a property of type [[Has type::String]]. >> >> >> I can't really come any further. Any hints? >> >> Cheers >> // Samuel >> >> -- >> Developer at www.uppmax.uu.se/uppnex >> <http://www.uppmax.uu.se/uppnex> / www.farmbio.uu.se >> <http://www.farmbio.uu.se> / rilpartner.se <http://rilpartner.se> >> G: http://google.com/+samuellampa >> B: http://saml.rilspace.org >> T: http://twitter.com/smllmp >> >> >> ------------------------------------------------------------ >> ------------------ >> Rapidly troubleshoot problems before they affect your business. >> Most IT >> organizations don't have a clear picture of how application >> performance >> affects their revenue. With AppDynamics, you get 100% visibility >> into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of >> AppDynamics Pro! >> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu= >> /4140/ostg.clktrk >> _______________________________________________ >> Semediawiki-user mailing list >> Sem...@li... >> <mailto:Sem...@li...> >> >> https://lists.sourceforge.net/lists/listinfo/semediawiki-user >> >> >> >> >> -- >> WikiWorks · MediaWiki Consulting · http://wikiworks.com >> > > > -- > Developer at www.uppmax.uu.se/uppnex / www.farmbio.uu.se / rilpartner.se > G: http://google.com/+samuellampa > B: http://saml.rilspace.org > T: http://twitter.com/smllmp > > -- WikiWorks · MediaWiki Consulting · http://wikiworks.com |