Created
March 15, 2011 09:57
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## 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