Is it possible to set the Site Homepage default by user or group?

We have 2 different companies owned by a holding company and we want to make it so when people from one company logs in, they are directed to one Home Page and when the other logs in, they are directed to another. I know it is possible for a user to override the default homepage by going into their profile settings, but we would like to do this administratively. possibly by assigning users in a group or role. Is this possible? I have not been able to find any information on the matter. 

2 answers

1 vote
Davin Studer Community Champion Jun 09, 2016

You could do this with a little bit of wiki ingenuity. First you will need to create a user macro for redirecting users. You can use the one below that was created by @Stephen Deutsch. You will also need the Visibility add-on. Next create a landing space and make that the default space in Confluence Admin (everyone needs view access to this space). On the home page of that space you will use the show if macro from the Visibility add-on combined with the redirect macro like such ...

image2016-6-9 15:32:26.png

 

Redirect User Macro

Macro Name:
redirect_macro 

Macro Title:
Redirect Macro 

Macro Body Processing:
No macro body 

Template:

## Macro title: Redirect Macro
## Body processing: N
##
## Developed by: Stephen Deutsch
##
## This macro redirects the user from the current page to a new page defined in the options.
## This macro more or less duplicates the functionality of the ServiceRocket Redirection Plugin
## Copyright 2014 zanox AG
## 
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
## 
##     http://www.apache.org/licenses/LICENSE-2.0
## 
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## @param location:title=Location|type=string|required=true|desc=The URL to redirect to
## @param delay:title=Delay|type=string|default=0|desc=The number of seconds to delay before redirecting the browser.
#set ( $Integer = 0 )
#set ( $delay = "0" )
#set ( $delay = $paramdelay )
#set ( $delay = $Integer.parseInt($delay) * 1000 )
#if ( $req.getParameter('redirect') != "false" )
  <script>
  setTimeout(function() {
    window.location = "$paramlocation";
  }, $delay);
  </script>
#end
<ac:macro ac:name="note">
  <ac:parameter ac:name="title">Redirection notice</ac:parameter>
  <ac:rich-text-body>
    <p>This page will redirect to <a href="$paramlocation">$paramlocation</a> in about $delay seconds.</p>
  </ac:rich-text-body>
</ac:macro>

Thanks @Davin Studer this is quite helpful. I tried it and got it to work! I created a test group and added myself and it did indeed redirect. My only question is, what if they need to view that specific Space at some point? Is it not possible once the Macro has been set?

Davin Studer Community Champion Jun 10, 2016

That is true. I would tend to make this landing space only for the purpose or redirection. If you want another common space that should be a different space. It's not totally ideal, but it's the only way I know to do it short of writing your own add-on.

Gotcha. Hopefully they can integrate something like this into Confluence at some point. Thanks for the help!

I was able to create a browser shortcut for specific users who we were restricting to one space only. This allows them to hit that space's main page right away. Prior to this, these users tried to hit the site homepage configured in the Confluence settings when they went to our base URL, and would get a page not found message in Confluence. 

So this is one option for a solution.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,526 views 25 14
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