Setting the Service Portal as the default starting page

jjoling
Tera Contributor

We want to make the portal the default starting point for all users.
So not only for endusers (without role) but also for workers (users with roles/ license).
And on the portal we want to add buttons for entering the backend or specific workspaces like the SOW for Servicedesk agents etc.

So first we have to set the "default landing page"?  I have been searching and i most of all see articles saying wich dashboard we can make as the start or landing page. Or are the default start page different form the landing page?

Also we need to configure two buttons at the portal that are only visible to users with certain roles.

How can we do all of this?

Anyone with any experience with this?

 

Many thanks in advance!

KR
Jacob.

3 REPLIES 3

Rajesh Chopade1
Mega Sage

jjoling
Tera Contributor

Thanks! This helps sending everybody to the Service Portal page. I stored this in my update set.

Now the next step creating the buttons that are visible for certain roles and send you to the related page (url) when click on it.

hi @jjoling 

In the Service Portal, create a new widget where you will define your buttons. In the HTML section of the widget, you can create your buttons using basic HTML. Use 'ng-if' to conditionally display buttons based on user roles. 

<div>
    <button ng-if="hasRole('role_name')" ng-click="redirectToPage('url1')">Go to Page 1</button>
    <button ng-if="hasRole('another_role')" ng-click="redirectToPage('url2')">Go to Page 2</button>
</div>

Replace role_name & another_role with the actual role names, and url1 & url2 with the desired URLs.

 

In the Client Script section of the widget, you can define the redirectToPage function and the hasRole function

function($scope, spUtil) {
    // Check if the user has a specific role
    $scope.hasRole = function(role) {
        return $scope.user.roles.indexOf(role) !== -1;
    };

    // Redirect to a specific URL
    $scope.redirectToPage = function(url) {
        spUtil.open(url);
    };
}

 

Add your widget to a page in the Service Portal and test.