Skip to content

Instantly share code, notes, and snippets.

@chids
Created March 15, 2011 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chids/870528 to your computer and use it in GitHub Desktop.
Save chids/870528 to your computer and use it in GitHub Desktop.
Confluence Wiki: Get the space key of the space that this page is being rendered in
##
## Atlassian Confluence Wiki User Macro
##
## Example of how to get the space key of the space that this page is being rendered in
## ie, not necessarily the same space as the page belongs to
##
#set($space=$renderContext.getOriginalContext().getSpaceKey())
## This will allow you to do magic based on the space
## I use it to display a different base URL for links
#if($space.equals("FOO"))
#set($domain="http://foo.bar.com")
#elseif($space.equals("BAR"))
#set($domain="http://bar.foo.com")
#else
#set($domain="http://foo.bar.baz.com")
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment