subspaces in the default spacecontent

jeff.storey April 1, 2012

I am trying to use the subspaces plugin to show a list of subspaces on the home page for a subspace. I have changed the default space content to include {subspaces:key=$spaceKey} but $spaceKey is not recognized in this context. Is there a way I can just configure the space content to list the subspaces of the current space?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Sandro Herrmann [Communardo]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2012

You can write a little usermacro :

## @noparams

#set($globalHelper=$action.getHelper())
$globalHelper.renderConfluenceMacro(" {subspaces:key=$content.spaceKey}")

Now give it a name and insert the usermacro call to the space content configuration. Works for my CF 4.1

jeff.storey April 3, 2012

Thanks, that seems to be what I'm looking for.

0 votes
NielsJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2012

The $spaceKey is only known within Velocity templates. The default space content is not such a Velocity template. The expression {0} gets replaced with the space key within the default space content[1]. So it should work if you write: {subspaces:key={0}}

1: http://confluence.atlassian.com/display/DOC/Customising+Default+Space+Content

jeff.storey April 3, 2012

Niels, unfortunately {subspaces:key={0}} will not work since {0} gives the name of the subspace, not the key.

NielsJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2012

Erm, sorry my fault. Please use Sandro's approach. The name for the macro could be "subspaces-currenspace".

jeff.storey April 3, 2012

Will do - thanks for the help.

TAGS
AUG Leaders

Atlassian Community Events