Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. VincentMassol1 +XWiki.LudovicDubost - Content
-
... ... @@ -2,19 +2,23 @@ 2 2 3 3 #toc("" "" "") 4 4 5 +1.1 XWiki Application Organization 6 + 7 +This [Best Practices document>Best Practices XWiki Application Organization] explains how to best organize an XWiki Application. 8 + 5 5 1.1 Check for Object existence in Class Sheets documents 6 6 7 7 Class sheet documents should be written using the following construct (this is an example for displaying documents containing XWiki.XWikiUsers objects): 8 8 9 9 {code} 10 - \#set($obj =\$doc.getObject("XWiki.XWikiUsers"))11 - \#if(!$obj)12 - \1 User Sheet14 +#set($obj = $doc.getObject("XWiki.XWikiUsers")) 15 +#if(!$obj) 16 + 1 User Sheet 13 13 This stylesheet must be applied on a document containing a XWiki.XWikiUsers object. 14 - \#else15 - \1\$msg.get("userProfile", [\$xwiki.getUserName($doc.fullName, false)])18 +#else 19 + 1 $msg.get("userProfile", [$xwiki.getUserName($doc.fullName, false)]) 16 16 ... 17 - \#end21 +#end 18 18 {code} 19 19 20 20 #info("The 'if' tests first for the non existence. This is so that XWiki extract the title from the ~~1 User Sheet~~, which is a proper title to display when viewsing the sheet page, instead of the computed name which will usually display something wrong.")