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

Is there any specific reason you created a new widget instead of using URL in menu



find_real_file.png



find_real_file.png


i have created a target field with values _blank, _target etc..



I was able to open the reset link in new tab using this method.


I'd prefer to use URL, but wasn't able to use _blank with any success.   Can you show how you got it to work?


create a target field on menu form with the below values



Screen Shot 2017-06-02 at 5.54.30 AM.png



After the target field is created, open header menu widget and in the Angular ng-temmplate related list find menuTemplate



Here is the updated code for menuTemplate



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


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


Nice!   I had tried the code you posted earlier but didn't get the same results - it's working now however.  


HR Rajashekar
Mega Expert

Hi Swetha,

 

Please use "_blank" in URL Target Field. it will work.

Mark correct if My Answer is correct

 

Thanks