How to add request icon and favourite icon in ESC portal on manually created widget

Shashank_sj10
Tera Contributor

We have manually created a widget to display the most recent catalog items. We would like to add the request and favorite icons as in  the out-of-the-box "Recommended for You" widget into our custom widget. How can we achieve that functionality.

 

Attaching screenshot for the reference.

Thanks for any help!

 

 

1 ACCEPTED SOLUTION

Juhi Poddar
Kilo Patron

Hello @Shashank_sj10 

 

You can look for fa icons to add it in this way. 

 

<span class="fa icon fa-heart" ng-class="data.favoriteIcon"></span>

//to add colour
span.fa.icon.fa-heart {
    color: red;
}

 

Please refer the link and look for the desired bootstrap icon.

 

"If you found my answer helpful, please like and mark it as the "accepted solution". It helps others find the solution more easily and supports the community!"

Thank You
Juhi Poddar

 

View solution in original post

7 REPLIES 7

Sakthi2
Giga Guru

Hi Shashank,

In OOB "ec_favorite" widget is embedded to the recommended for you widget. 

https://dev262598.service-now.com/sp_config?id=widget_editor&sys_id=523f6529532d0110fedfddeeff7b1298....

 

You have to embed this favorite Icon to your custom widget in the server side and pass the params.

 

Sakthi2_0-1731394695700.png

 

for request, you can just add a <a> tag with the item sys_id with it. SO when users click on the item they will be redirected to the item page and they can submit a request there.

 

 

Please mark this as correct answer if this has helped you with your requirements. 

 

Regards,

Sakthi Varun. H

Hey Sakhti,

 

Thanks for the reply 
I'm not getting your suggestion, Have you done this before? 
Could you please provide the exact code what we need to and where?

 

Thanks in advance!

 

Juhi Poddar
Kilo Patron

Hello @Shashank_sj10 

 

You can look for fa icons to add it in this way. 

 

<span class="fa icon fa-heart" ng-class="data.favoriteIcon"></span>

//to add colour
span.fa.icon.fa-heart {
    color: red;
}

 

Please refer the link and look for the desired bootstrap icon.

 

"If you found my answer helpful, please like and mark it as the "accepted solution". It helps others find the solution more easily and supports the community!"

Thank You
Juhi Poddar

 

Thanks for the solution @Juhi Poddar , I was able to add favorite icon.

But is there any idea - how can I add or call the favorite icon widget in my custom widget so that clicking on the icon add the catalog to the my favorites page.

 

Thanks in advance for any help!