Change the redirection of breadcrumb - SP

Nitin_NOW
Tera Guru

Hello everyone 

I'm trying to change the redirection of 'Service Catalog' in the breadcrumb. 

find_real_file.pngCurrently if we click on Service Catalog I see the page is being redirected to the page 'sc_home'. I'm trying to disable this redirection and would like to redirect it to separate page, onClick. 

I have cloned the breadcrumbs widget and changed the below line in the HTML code

<a ng-href="{{item.url}}">{{item.label}}</a>

to 

find_real_file.png

 

I'm defining the href link directly assuming this is what it is triggering the Service Catalog to 'sc_home' page. However even on my change it doesn't work and still redirect to the home page.

Is there any other place changes to be implemented for a successful redirection?

Thanks

1 ACCEPTED SOLUTION

Nitin_NOW
Tera Guru

I finally figured out by restricting the links in breadcrumbs by adding the below lines in HTML template.


<a ng-if="item.label != 'Service Catalog'" ng-href="{{item.url}}">{{item.label}}</a>

<a ng-if="item.label ==='Service Catalog'" ng-href="?id=sc_category&sys_id=e15706fc0a0a0aa7007fc21e1ab70c2f">{{item.label}}</a>

Kind of hard code to 'Service Catalog' label which redirects to above URL and for rest of the links it works as usual.

Thanks!

View solution in original post

9 REPLIES 9

Yes I did that already, but seems it is not working. 

timmyweytjens
Tera Expert

Hello,

 

Have you replaced the instance of the breadcrumb widget on the page with your custom widget?

Yes I replaced the widget with my custom one and now for every breadcrumb link it takes me to that same URL/page. Is there anyway we can restrict the redirection only if user clicks on 'Service Catalog' from the breadcrumbs?

Any help appreciated!

Nitin_NOW
Tera Guru

I finally figured out by restricting the links in breadcrumbs by adding the below lines in HTML template.


<a ng-if="item.label != 'Service Catalog'" ng-href="{{item.url}}">{{item.label}}</a>

<a ng-if="item.label ==='Service Catalog'" ng-href="?id=sc_category&sys_id=e15706fc0a0a0aa7007fc21e1ab70c2f">{{item.label}}</a>

Kind of hard code to 'Service Catalog' label which redirects to above URL and for rest of the links it works as usual.

Thanks!

luis huallpa
Tera Contributor

Hi @Nitin_NOW , were you able to find out how to update that variable?
Regards.