How to add missing breadcrumb?

Akhil Pendem
Tera Contributor

Hi all,

We've a widget "See my tickets" on one of our portals homepage. When we click on it, takes us to a page which shows the tickets raised by the logged in user.

find_real_file.png

Here the breadcrumbs are: Home > My Tickets

When we click on a ticket, a new page opens in the same window as below:

 

find_real_file.png

Here we're missing the parent breadcrumb "My Tickets".

Please help!

 

Thanks!

Akhil.

3 REPLIES 3

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Hi,

 

This is OOB functionality and how it works. If you want it to have "my tickets" in there was well, you need to build in functionality i any of the widgets to handle breadcrumbs like that.

 

Good example is the "SC Category page" widget. If you look at the client script code there in the top you can see the code. Another way would be to customize the breadcrumbs widget, but I wouldn't go down that way since it's better to use the OOB way.

 

//Göran

Dan Conroy
ServiceNow Employee
ServiceNow Employee

Take a look at Nathan's answer here. You will need to fire the sp.update.breadcrumbs event from a widget.

Akhil Pendem
Tera Contributor

Hi Goran and Dan,

For this issue, I've cloned the OOB breadcrumb widget and edited the HTML content as below:

<ul class="nav nav-pills nav-sm" aria-label="${Navigation breadcrumbs}">
<li>
<span><a ng-href="?id={{portal.homepage_dv}}">${Home}</a>
<i aria-hidden="true" class="fa fa-chevron-right"></i></span>
</li>
<li>
<span><a ng-href="Some URL">${My Tickets}</a>
<i aria-hidden="true" class="fa fa-chevron-right"></i></span>
</li>
<li ng-if="!c.expanded &amp;&amp; c.breadcrumbs &amp;&amp; c.breadcrumbs.length > 2">
<span><a ng-click="c.expand()"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></a>
<i aria-hidden="true" class="fa fa-chevron-right"></i></span>
</li>
<li ng-if="!c.breadcrumbs"><span><a style="display: inline;" href>{{page.title}}</a></span></li>
<li ng-if="c.expanded || ((c.breadcrumbs.length > 2 &amp;&amp; $index > c.breadcrumbs.length-3) || (c.breadcrumbs.length <= 2))" ng-repeat="item in c.breadcrumbs track by $index">
<span><a ng-if="!$last" ng-href="{{item.url}}">{{item.label}}</a>
<a class="a-disabled" ng-if="$last" ng-href="{{item.url}}">{{item.label}}</a>
<i aria-hidden="true" ng-if="!$last" class="fa fa-chevron-right"></i></span>
</li>
</ul>

And replaced the OOB "breadcrumb" widget on the "ticket" page with this new one.