Hello,
I'm trying to create a user macro showing the home space key of the current user in plain text. Any ideas?
Hi @frithjof falck
Please follow the Guide here to create the User Macro
Macro Name: spacekeyMacro Title: Space KeyDescription: Adds the current space key as textCategory: Confluence ContentMacro Body Processing: No macro bodyOutput Format: HTMLTemplate: $space.getKey()
Let me know if this works
Thanks,Pramodh
Hi @frithjof falck ,
please create a user macro, with name and categories at your convenience, with :
## Macro title: My Macro## Macro has a body: Y or N## Body processing: Selected body processing option## Output: Selected output option#### Developed by: My Name## Date created: dd/mm/yyyy## Installed by: My Name## This is an example macro## @noparams#if($spaceManager.getPersonalSpace($action.remoteUser))$spaceManager.getPersonalSpace($action.remoteUser).getKey() #else No Personal Space#end
Key of the current user will appear if the current user has a Personal Space. Hope this helps, Fabio
Any possibilities for the output to be the current users spacekey? I'going to add it in a <a> tag so that the user will be directeded back to its home space
@frithjof falck if you need a link to that space please change Macro Body processing and add <a> in my previous code.
Ciao,
Fabio
Thanks!
Any chance of getting the home space key of the user instead of the personal space key? If that makes any sense.
what you mean the home space key for the current user? User can have a personal space or he could be the creator of many spaces?
WHat link do you need?
You need to use the macro for this scenario!!
It looks like you're new here. Sign in or register to get started.