Breadcrumb widget - generating URL dynamically.

Geeky
Kilo Guru

Hi All,

I want to redirect user to a custom page whenever a they click on the breadcrumb link. For example, if you see the image below, its redirect user to sc_category page but I want to change that page to custom_sc_category page which is a clone of sc_category page.

I tried to clone breadcrumb widget but I do not see any code that specifies the page.

I have actually cloned the sc_category page but not sure which part of code to update to redirect the user.

 

 

1 ACCEPTED SOLUTION

Siddhnath Pande
Mega Guru

Hey Geeky,

For that you have to clone the Breadcrumb widget & change a line of code which as follow:

<span><a ng-href="?id={{portal.homepage_dv}}">${Home}</a>

The above code is the OOTB Breadcrumb code line number 3

You have to change this into 

<span><a ng-href="?id=your_page">Previous Page </a>

Here is a link community link where I have explain this in detail you can look into it.

https://community.servicenow.com/community?id=community_question&sys_id=24f90b92db94189023f4a345ca96...

 

If the above code helps then please mark my answer Correct and Helpful.

Thanks and Regards:
Siddhnath Pandey

View solution in original post

6 REPLIES 6

Vishwa Prakash
Kilo Expert

Hi,

I understand you would like to redirect the user to the custom page. The image you have inserted is not showing. Please reinsert the images so I can have clear understanding of what you have done.

However I have found a similar scenario in the community you might wanna take a look at. Here's the link.

Hope that helps.

Please mark my answer correct and helpful.

Thanks

Hi Vishwa,

 

I have added new images as attachments. Here is what I want to do;

Clone sc_category and sc_cat_item page and replace it with new pages. But just cloning does not work, it should have some code changes as well along with the widgets changes within those pages.

Breadcrum is one of the cloned widget in the cloned page which is not working.

Appeciate if you could help me on this.

 

Hi Geeky, 

You can achieve this by adding anchor link in the cloned breadcrumb. with the help of anchor link you can redirect the user to any page you want. If this does not help please get back to me and we will find another way of doing this.

Please mark my answer helpful and correct.

Thanks

Hi Vishwa,

How does that help? Breadcrumb URLs are dynamically generated. Putting a static anchor link won't help. 

What I did is cloned OOTB Breadcrumb widget and added it to the cloned sc_category page. Breadcrumb is forming correcting with the right data but URLs embedded in the breadcrumbs are not correct. They are still redirecting me to the original OOTB page. I want to redirect to the clone sc_category page.

Appreciate if you can help me further on this.