velocityxwiki

Velocity trim() method


For example

$xcontext.user -> Xwiki.user.trim('Xwiki')

"XWiki." How can I remove the expression? I tried this but it did not work.


Solution

  • Just extract the page name (i.e. profile page name) from the current user's reference. It's the best way and you avoid String manipulation:

    $xcontext.userReference.name