Forums

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

Showing SubSpace application/plugin navigation for only specific spaces

ashok_chava ashok_chava
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 12, 2020

We are running data center version of the confluence.

We have a requirement where we have to show subspace navigation element only in specific spaces.

  • To do this we have tagged those spaces with "Subspace" category. We should be showing SubSpace navigation to only on these spaces and hide for the rest of them.

Following is the way I have achieved this

  • Created piece of velocity code in Look and feel -> Layouts -> Main Layout
    <div id="categoryKeyInfo">
       #if ($sitemeshPage.getProperty("page.spacekey"))
     $action.labelManager.getTeamLabelsForSpace($sitemeshPage.getProperty("page.spacekey"))
                     #end
     </div>

    The purpose of above code is to get the category information from the current space. As per the documentation and my testing getTeamLabelsForSpace gives us the categories of the space.

  • Next I have included Look and feel -> "custom HTML" code "At end of the BODY"
    <script>
     document.addEventListener('DOMContentLoaded', function(){ 
        //alert(document.querySelector("#categoryKeyInfo").innerHTML) if(!document.querySelector("#categoryKeyInfo").innerHTML.includes("Subspace")){
     var subSpaceBar=document.querySelector("#navigationbarpro");
     subSpaceBar.style.display="none";
     }
     }, false);
     </script>

    This above code finds if the space has category as "Subspace" and shows the SubSpace app navigation or it will hide it.

This approach is working but wanted to make sure that this is the right way to achieve this. Is there any better way to do this? Please let me know.

 

 

1 answer

0 votes
JP _AC Bielefeld Leader_
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.
February 12, 2020

Hi,

you might want to contact Communardo (SubSpace vendor) on your question directly:

https://jira.communardo.de/servicedesk/customer/user/login?destination=portals

I'm sure, they will love to support you!

Best

JP

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events