How can I edit the Menu with type URL (external content) in Service Portal?

ssswetha13
Tera Contributor

Hi All,

I have created new menu's with the type as URL and the link is an external content. The requirement is such that, whenever the user clicks on link it should open in a new tab.

Please let me know where and how can I edit the Menu.

I have already tried a few things: Editing the theme using CSS. and Configuring the Header widget.

14 REPLIES 14

Hi Anurag,



Thanks for your input.



Did you write the code in the page to redirect it? If yes, then i guess that would not be feasible for me to do as I have redirected the link to a particular company's website. Its just that it is not opening in the new tab and I dont know where to write the code for it.


Are you still looking s solution for this



This is what I was able to achieve



Updated a Angualr ng-template called "menuTemplate"



<a ng-if="item.items.length == 0 && !item.scriptedItems && item.type == 'url'" ng-href="{{item.href}}" target="_blank">{{ item.label }} </a>


<a ng-if="item.items.length == 0 && !item.scriptedItems && item.type != 'url'" ng-href="{{item.href}}">{{ item.label }} {{ item.type }}</a>


<a ng-if="item.items.length > 0" href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ item.label }} <span class="caret"></span></a>


<ul ng-if="item.items.length > 0" class="dropdown-menu" role="menu">


      <li ng-repeat="item in item.items" ng-include="'menuTemplate'" />


</ul>


<a ng-if="item.scriptedItems.count > 0" href="javascript:void(0)" data-toggle="dropdown" title="{{item.hint}}">


      <span ng-bind-html="item.label"></span>


      <span ng-if="!item.scriptedItems.omitBadge" class="label label-as-badge label-primary sp-navbar-badge-count">{{item.scriptedItems.count}}</span>


</a>


<sp-dropdown-tree ng-if="item.scriptedItems.count > 0" items="item.scriptedItems.items" />




Here I updated the condition to check if the type is URL then open it in a new TAB..


Can you provide more detail of what you did here?   I've got a new page ready for use with a custom widget but it's not acting as I had hoped.   The best way to make the redirect work is eluding me.



Pop-up blocker picks up the redirect - which is not terribly helpful in this case.


My redirect doesn't leave the main Portal page as is, which seems weird to me.



All the Widget has in it is Client Script:



function() {


window.open('https://spectrum.okta.com/signin/forgot-password');


window.resizeTo(500,300);


//   var c = this;


}



I added the last part from here:   Requested pop-up that won't be blocked


What our requirement was when users clicks on knowledge it should take them to a new tab instead of the existing tab


Screen Shot 2017-05-31 at 6.20.25 PM.png



Is this is what you are looking?




also in the client script you need to use $window service


The link takes you to our SSO solution website (Okta) which is technically outside of ServiceNow, so instead of closing the Service Portal I want it to open a new tab.


find_real_file.png




I'm not sure what you mean by your last sentence.