How to remove the HTML field editor from the service portal.

Shivam26
Tera Contributor

I want to hide this whole HTML field layout and just want to show the URL in the Service Portal, Please find the below screen-shot for the same:

find_real_file.png

 

I also tried to hide using the CSS, but it still didn't workout:

CSS:

.mce-flow-layout {
    display: none;

}

find_real_file.png

Please help me with this.

1 ACCEPTED SOLUTION

AnirudhKumar
Mega Sage
Mega Sage

Make the field read-only

View solution in original post

5 REPLIES 5

Mark Guldhammer
Giga Guru

Hi

You can try this, that seems to work for me.

.mce-toolbar-grp { display: none; }

 

Where are you trying to do this?

Hi Mark,

I am trying to do this in a widget as I have used "$sp.getForm" to populate the form and this field is inside the form, So I just want's to display the URL and not the whole HTML Field Editor.

Regards,

Shivam.

Hi

Okay, well as other people mention, the easiest way would probably be to change the data type of the field, since the $sp.getForm() returns the whole form, without being able to edit html.

But if that is not possible, then I think the easiest way would be to get the record in the server script, and then pass that to the html.

 

Server script example

var gr = new GlideRecord('incident');
gr.get('some sys id');
gr.query();

if(gr.next()) {
  data.my_url = gr.getValue('url_field');
}

 

On the HTML side, you could do something like this.

<a href="{{c.data.my_url}}">URL</a>

 

Then you can display it, how ever you like.

AnirudhKumar
Mega Sage
Mega Sage

Make the field read-only