Display Variable Label as a clickable hyperling

leahp
Kilo Guru

I have several catalog items that are used in an order guide.  The requirement is to have the labels of the variables display as a clickable hyperlink so that users can access the knowledge / help for that particular field.  There are about 65 of these so I would prefer to not go the UI macro route - but rather handle it all in one catalog client script.

But when the label is a clickable hyperlink, it will no longer show the red asterisk indicating a field is required.  Is there a way to use a catalog client scriptto render the label as a hyperlink and still show red asterisk indicating field is required?

5 REPLIES 5

SanjivMeher
Kilo Patron
Kilo Patron

Would you prefer adding the link to More Information in the variable?


Please mark this response as correct or helpful if it assisted you with your question.

No, they specifically want the label to be the link, not the more information 

 

Mark Stanger
Giga Sage

I'm sure it's possible to hack together a client script or macro variable to make this happen, but it really shouldn't happen.  The problem with any solution to make this work is that it's going to require DOM manipulation or the creation of custom code/variables.  While that may work fine in the standard catalog interface now, it's definitely not going to work on mobile or in the Service Portal.  It's also something that's pretty likely to break during a future upgrade.  You can include HTML and links in the description, but I'd strongly advise you to push back on this requirement if it means hacking 65 variables.

Thanks Mark. 

 

I did find that the catalog client script does still function in our service portal and this particular form is not available through our mobile interface (it is an order guide that is a pretty lengthy set of variables) But I do have concerns about the impact future upgrades may impact the code below ( I am not familiar with DOM manipulation)

 

Below is the script that runs in an onLoad Catalog Client Script - is this DOM manipulation?

 

 

$$('label').each(function(i){ if (i.innerHTML.indexOf('Display Name') >-1) { var text = "<a href='https://confluence.acxiom.com/pages/viewpage.action?pageId=30158917' target='_blank'>"+"Customer Display Name"+"</a>"; i.innerHTML = text; } });

 

 

Wil