Get link of space home

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

This widget could not be displayed.

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/

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)

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".

You're awesome, thanks alot Charles :)

This widget could not be displayed.

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.

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!

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

This widget could not be displayed.

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
Community showcase
Posted Sep 17, 2018 in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

569 views 7 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you