You should share that kind of things on
http://code.xwiki.org ;)
On Thu, Apr 1, 2010 at 18:21, coldserenity <muntyanu.roman(a)gmail.com> wrote:
Sorry for spam, just can't resist sharing my first small victory in
programming XWiki :)
XWiki 2.0 Markup-based code-snippet for displaying user's full name with
link to profile by log-in.
{{velocity}}
#macro(displayFullNameByLogin $login)
#set($userDocName = "XWiki."+$login)
#set($userDoc = $xwiki.getDocument($userDocName))
#if (!$userDoc)
$login (does not exist)
#else
#set($userObject = $userDoc.getObject("XWiki.XWikiUsers"))
#if(!$userObject)
User Sheet
This stylesheet must be applied on a document containing a
XWiki.XWikiUsers object.
#else
[[$xwiki.getUserName($userDoc.fullName,
false)>>$userDoc.fullName]]
#end
#end
#end
{{/velocity}}
Usage
{{velocity}}#displayFullNameByLogin("rmuntyan"){{/velocity}}
Regards,
Roman
--
View this message in context:
http://n2.nabble.com/Code-snippet-Full-user-name-and-link-by-log-in-tp48381…
Sent from the XWiki- Users mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne