The CreatorCon Call for Content is officially open! Get started here.

Need a simple widget with a button that redirects to another Service Portal page

LRhodes
Tera Guru

Hi all,

I'm trying to create a very basic widget that displays a button and when pressed will direct the user to another page on the Service Portal.

I have the button, but so far clicking it does nothing so I'm clearly missing some functionality.

 

HTML Template:

<div class="m-b text-center">
<button type="button" name="link" class="btn btn-primary btn-question" ng-click="c.action('redirect')">Check Validation Status</button>
  </div>

 

Client Script:

var c = this;
c.action = function(redirect) {
	
var link = '?id=checkvaluationstatus';
top.window.location = link;
	
}

Any help is greatly appreciated.

1 ACCEPTED SOLUTION

Dom Gattuso
Mega Sage

@LRhodes 

Please try the below changes: 

api.controller=function($window) {
        var c = this;

        c.action = function(redirect) {
                var link = '?id=checkvaluationstatus';
                $window.location.href = link;
        }
}

View solution in original post

3 REPLIES 3

Saloni Suthar
Mega Sage
Mega Sage

Hi @LRhodes ,

 

You need to add a link-button widget in the portal which will allow you to directly add a link in the instance options.

 

SaloniSuthar_0-1713967288423.png

SaloniSuthar_1-1713967308882.png

 


If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni

Dom Gattuso
Mega Sage

@LRhodes 

Please try the below changes: 

api.controller=function($window) {
        var c = this;

        c.action = function(redirect) {
                var link = '?id=checkvaluationstatus';
                $window.location.href = link;
        }
}

Thanks Dom, this did the trick.