The problem with this suggestion is that it does not take in account the includes.
Right now, all our groups' home page is on syntax/1.0 (normal, they're old) and they include a page that is syntax 2.1. Thus a syntax 2.1 renderer is used even though the "$doc" variable has syntax 1.0. Isn't there something more contextual? Something such as $context.currentSyntax ? thanks Paul Le 23 janv. 2014 à 03:55, Sergiu Dumitriu <[email protected]> a écrit : > On 01/22/2014 08:50 PM, Paul Libbrecht wrote: >> >> Hello fellow developers, >> >> at curriki we are slowly evolving to xwiki 2.1 (finally!) and it is not too >> easy. >> Some of our objects are rendering user-interfaces messages that are >> expressed in xwiki syntax. To do so, they have the context. >> But these objects are rendered sometimes in syntax 2.1 or syntax 1.0… >> >> Is there a way to tell the "current" syntax in the context object? >> >> thanks >> >> paul > > Hi Paul, > > 1. $doc.syntax [1] > > 2. Something useful: > > #foreach($d in $xwiki.searchDocuments("where doc.syntaxId='xwiki/1.0' or > doc.syntaxId is null or doc.syntaxId = ''")) > * [[$d]] > #end > > 3. That is why translation messages should not contain wiki markup or > HTML code. See the paragraph starting with "Don't include markup in the > translation" at [2]. > > [1] > http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/Document.html#getSyntax%28%29 > [2] http://dev.xwiki.org/xwiki/bin/Drafts/L10N+Conventions > > -- > Sergiu Dumitriu > http://purl.org/net/sergiu > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

