It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to link to category in space directory in confluence?

Alex Yasurek Jan 14, 2015

Hi,

Does anyone know if it is possible to create a link that will bring a user to the space directory and already have a specific category selected? I know there is a macro that can do this but that has to live on a page in a space. We would like to take users to the space directory page with some category already selected.

Thanks

2 answers

1 vote
Stephen Deutsch Apr 10, 2015

I know this is an old question, but I recently found out how it works.  Confluence uses local storage to keep track of which tab is selected when the page is opened.  You can do something like the following in an HTML macro:

<a href="#" onclick="localStorage.setItem('lastSelectedSpaceDirectoryTab', '{\x22type\x22:\x22space-labels-list\x22,\x22tabName\x22:\x22space-category\x22}');window.location=contextPath+'/spacedirectory/view.action';">space-category</a>

and just replace the "space-category" with the space category you want.

0 votes
Larry Wilson Oct 26, 2016

This does not work for me ... is there a recommended way to do this; the space macro is useless; ..

Why won't something like this this work?

http://jira-host:8090/spacedirectory/view.action#space-search-result?data-tab-name="devops"

Stephen Deutsch Oct 26, 2016

You need to make sure that you change both texts where it says "space-category" (there is also one in the code between \x22) and you need to make sure that the name is completely in lower-case.

Larry Wilson Oct 26, 2016

my editor (addon html) keeps removing the onclick portion ...

guess I need to get that working first

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

6 Awesome Ways to Apply Trello, JIRA and Confluence to your Project

I attended  Atlassian Summit 2019  and learned a lot from the presenters, attendees and knowledgeable Atlassian product managers. The presentations I attended focused on applying Agile, pla...

1,228 views 7 18
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you