Forums

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

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

Digilant Admin June 2, 2016

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
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.
June 9, 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>
Digilant Admin June 10, 2016

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

Digilant Admin June 10, 2016

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

0 votes
Mike McNamara
Contributor
August 2, 2018

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
TAGS
AUG Leaders

Atlassian Community Events