confluence: show spacekey

I would need just to show the spacekey within the space homepage. (we use confluence 5.1)

I know that there's a space information macro, but this is too much.

Is there any possibility to have a text like this "spacekey: ..." ?

this would be VERY helpful - thx!!

4 answers

You can create a user macro and add the following:

## @noparams
$space.key

This will show the space key.

Alternatively, you can use JavaScript:

AJS.params.spaceKey

which will return the spacekey

wow it works, thanks!!!

i created my first user macro :)

but could I maybe add options like show the spacekey of the parent space?

Glad to hear that :)

The concept of "parent space" is not available in Confluence. Are you using a third-party plugin?

Do you want the content of the Home page to only show the space key? Or is it the URL address?

i would really only need the spacekey (ideally to be shown on any page). because there are some macros, eg the subspaces macro that needs the spacekey instead of the space name and its quite annoying being in the edit mode and then having to get out again, check the spacetools and so on just to get to know the spacekey. it would be cool if there was a macro named "show spacekey" with the parameter "space" that in the end looks like 'spacekey: xyz' then i could use it on any page for any space. for example: we have the subspaces macro to show the children and on other occasion show spaces of the same hierarchical order. so we sometimes need the spacekey of another space too.

If this was a macro and you were editing the page wouldn't it just revert to being a box?

Can you just take note of the Key in the URL paramater before you go into edit mode?

no, i'm using the subspaces macro and therfore have 'parent'-spaces.

(sorry for the late answer - i got a baby in the meantime ;) )

Hi, did you solve the problem? Can you get the spacekey of parent space?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

414 views 2 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you