Find Questions…

Close ×
First time here? Check out the FAQ!

subspaces in the default spacecontent

jas511 asked this question · 26 karma ·

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?

396 views

2 Answers:

Sandro Herrmann [Communardo] · 1,965 karma ·

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

jas511 · 26 karma ·

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

Niels Jaeckel · 2,317 karma ·

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

jas511 · 26 karma ·

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

Niels Jaeckel · 2,317 karma ·

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

jas511 · 26 karma ·

Will do - thanks for the help.

Looking for something else?

Find Questions…

or Browse other questions tagged:

or Ask a Question