Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get link of space home

wcms January 15, 2013

Hi there

Is there any way (for example a wiki markup) which will get me the the name and url to the home of the current space?

I'm asking this because we've modified the "Documentation Theme" in Administration -> Look and Feel -> Site Theme to show the Link to the Home of the wiki in the navigation. We just added a [Home].

Now, this works fine as long as nobody changes the title from Home to something else. Therefore it would be nice if there was some wiki markup which would get me the name and url of the space home. I tried [spacekey:] but this doesn't work unfortunately.

Thanks!

3 answers

1 accepted

2 votes
Answer accepted
CharlesH
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.
January 16, 2013

A user macro will do the job nicely here. Take a look at this complete macro which does a lot more than you needneed. It will be quite simple to cut out the stuff you don't need though.

http://blog.networkedcollaboration.com/2012/05/03/confluence-space-meta-data-user-macro/

wcms January 16, 2013

Hey Charles

You're the man! This works great, I snipped everything out except for the getSpaceHome part, and it works. Only problem is, that it's displaying a home icon next to the item. Any idea how to get rid of that?

## @noparams

## Get space details
#set ( $spaceHome = $space.getHomePage() )

## Display Space Details
#contentLink2($spaceHome true false)

CharlesH
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.
January 16, 2013

I experimented with the two boolean parameters for the function contentLink2. Here's the results:

true false - shows the home icon in front of the link

true true - shows the home icon in front of the link, and the space name in brackets after it

false false - shows just the link

false true - shows the link followed by the space name in brackets after it

So you need "false false".

wcms January 16, 2013

You're awesome, thanks alot Charles :)

1 vote
Daniel Borcherding
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.
January 15, 2013

Hello,

It looks like you might be interested in one of the feature requests that I filed last week.

https://jira.atlassian.com/browse/CONF-27737

This feature would add support to link to the @<location> tags within confluence. You could just create a link to @home and jump back to the home of your space regardless of the name.

Please visit this issue and add your vote in the upper right hand corner.

wcms January 15, 2013

Hey Daniel

I did vote for the request, thanks for the tip. Does this mean there's no way to do this currently? Maybe I should try something with jQuery (like putting a placeholder into the Documentation-Theme, then get the current URL and reduce it to https://domain.com/display/SPACEKEY so I can replace the placeholder with it).

Thanks again!

Daniel Borcherding
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.
January 15, 2013

There is no way that I am currently aware of that you are able to link to the home page of a site irrespective of name. If you are already using the Documentation theme you could enable the page tree macro to have Confluence render out the full page tree. You would then be able to use that macro to navigate back up to the home of the site. But I don't beleive there is a way to just create a single link that points at the home

0 votes
CharlesH
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.
January 16, 2013

A user macro will do the job nicely here. Take a look at this complete macro which does a lot more than you needneed. It will be quite simple to cut out the stuff you don't need though.

http://blog.networkedcollaboration.com/2012/05/03/confluence-space-meta-data-user-macro/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events