How to get current space category in confluence refinedwiki Original Theme Header

We are using Confluence for our technical documentation and refinedwiki Original Theme Plugin to customize the design. Documentation is available in two languages (German, English). Spaces are organized as follows:

Category: "German"

Space: "Product 1 - DE"
Space: "Product 2 - DE"

Category: "English"

Space: "Product 1 - EN"
Space: "Product 2 - EN"

In the site header, I'd like to place links to Product 1 Home, Product 2 Home, ... in current language. (I try to modify the site header using the textbox provided by OriginalTheme > Manage custom design.)

That means:

If the current page is in a space that has category "German":

Link: "Product 1" => Space "Product 1 - DE" - Home

Else

Link: "Product 1" => Space "Product 1 - EN" - Home

I understand that I can use Velocity functions so a simple if should do the job if I could get information about the current space.

How can I access the category of current space?

2 answers

1 accepted

hi there!

I'm not sure if that would be possible. I believe that the best would be to contact the refinedwiki team and ask them the possibility to customize the plugin this way. If you could paste here their answers would be great :)

Rodrigo

Hi Rodrigo,

thanks for your reply. Here's the answer from refinedwiki team.

#if ($sitemeshPage.getProperty("page.spacekey"))
    #set($spaceInfoBean = 
OriginalThemeHelper.getSpaceInfoBean($sitemeshPage.getProperty("page.spacekey")))
    $spaceInfoBean.categoryNameKey
#end

This is not an official API so I assume it might change in future releases.

PS: Thumbs up for refinedwiki support team. Fast an qualified answer. Great ;-)


Yeah! After 4..5 hours of searching how to get the current space key (and the category key) in top.vm of RWT I've found this. Thx!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

253 views 11 10
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