Add text to catalog item for Service Portal

scwillson
Mega Guru

I am still unable to add info text to a catalog item (more specifically in my case; Order Guide) that is visible when using the Service Portal.

Does anyone have a suggestion for a work-around?

  • A few versions ago, we used to be able to set an HTML field type as read only, and it would display as just text on the form. no longer
  • In the past, I've build small custom UI pages, and inserted them with the UI page catalog variable. The UI page doesn't show through Service Portal
  • I tried using a UI Macro with label, but only the label part shows in the Service Portal.
  • I currently have Client script putting up field messages, but those don't load for me in Service Portal

I've already had to strip out all my containers because they cause Service Portal to lock up.... this is very frustrating...

Here are 2 screenshots to show what I am talking about (with the last bullet point above):

Field messages showing when using the form directly through the Catalog:

find_real_file.png

When using Service Portal, no messages.

NOTE: I have already confirmed that the Client Script has it's UI Type field set to "Both".

find_real_file.png

1 ACCEPTED SOLUTION

Akshat Chawla
Giga Expert

Hi,



In this case if it's simple text, you can create a "label" type variable and text in the variable then place the variable where required as per your requirement.


View solution in original post

8 REPLIES 8

One of the drawbacks of the "Label" type you may be referring to is the character limit on the variable Question field (255 by default?). I've never used the HTML field before, but I just found it in the product documentation and had [momentarily] been excited to apply it to this exact use case!



Unfortunately for me, I'd need more than 255 characters to capture the message I'd like on the form (and I'm not keen to raise default character limits). Fortunately for me, we're not using a service portal or mobile devices yet, and this particular catalog item is nearing its end of life, anyway (so I may go with HTML, anyway).



I do wonder when that "...not yet supported on service portal and mobile devices" warning will go away. (It doesn't appear to be with Istanbul.)


Community Alums
Not applicable

Hi ,

for more text what we have to do?

Community Alums
Not applicable

Hi ,

for more text what we have to do?

stewtaylor
Tera Contributor

I ran into the same issues but found that when putting html into the label, it only accepts simple html.   As an experiment, I tried adding some styles to the label like this : <p>test <span style='color:green'>html</span></p>   only to find that the style tags get stripped before reaching the browser.   I'm not sure what is being done by SN in the background here, so didn't want to trust using labels.



Instead, I've created a simple widget that will display html on our catalog items:


2017-01-09 16_00_06-Clipboard.png



The in the catalog item call the widget as many times as you like by creating a macro for each piece of text you want to create.   In the macro, go to the Default Value tab, then pass your html to through the options object (anything you specify in the Default Value field within the a JSON string is available from c.options in the widget itself):



2017-01-09 16_05_50-Clipboard.png



You will need to be careful with the html you put into the JSON string.   Depending on what you are trying to output, you may need to escape it first.