How to add a hyperlink to a label on a catalog item form?

JennyHu
Tera Guru
Tera Guru

Hi community,

Is there way to add a hyperlink to a label field on a catalog item form?   Our use case is that we have a checkbox that asks if the user accepts the Terms & Conditions.   We would like to have Terms & Conditions hyperlinked.

I am currently using an onLoad catalog client script that references the $$ object and sets the innerHTML.   It works in our CMS portal.   We are migrating our portal from CMS to Service Portal.   In Service Portal, the following JavaScript error pops up:

"TypeError: $$ is not a function"

Any idea why?   We are running on Jarkata.

Thanks in advance,

Jenny

1 ACCEPTED SOLUTION

lSurya 24
Giga Guru

Hello Jenny,



Create a field type as a macro. And place a widget in that field which would have you link, say that < a href="www.community.com">link</a> in the widget which you are adding to the created field on the record producer. Now it will show as a link on service portal.



Note: widgets will not display on cms portal or instance. Test in service portal only.



find_real_file.png



to create a widget:


find_real_file.png


View solution in original post

7 REPLIES 7

art_jones
Kilo Sage

Hi Jenny;



As Surya mentions, there are ways to provide something maybe similar to what you need, but unfortunately Service Portal doesn't support many of the globals and APIs that were available in the CMS (e.g. $$), so the code you've used in the past won't work (obv. you have found that out).  



This post has some detail:   document.getElementById("item_title").innerHTML is not working in Service Portal



Regards, Art


Thanks Art. That post is quite helpful!


462239
Kilo Explorer

Hello All,

 

Even i am running out of similar issue, Link with Macro variable is fine, but i have to add a hyperlink in CHECKBOX type variable. can anyone help me on this? I dont see widget in check box type variable.