hi,
i´m writing a usermacro in which i want to get the username from the page on which the macro is placed.
$user.name does not work.
maybe something like:
getUserFromPage(this)
thanks for your help
Hi @Kianusch ,
what do you mean by username? The creator or the last author or anything else?
i mean the creator of the macro, but because of the fact that the macro will be used on on the users personalspace (Homepage) it can also be the user of the page on which the macro is placed
Well, the creator of the macro is always you, so why using a function for this? Just drop your name in the code of the macro.
If you want to get the name of the logged on user, just try
$action.getRemoteUser().getFullName()
If you want the creator of the page use this:
$content.getCreator().getFullName()
It looks like you're new here. Sign in or register to get started.