How do you hide the preview icon (i) from a reference variable on the Service Catalog?

Community Alums
Not applicable

Hi all,

I'm trying to find the best solution to remove the preview icon from one of my reference variable (Requested for) from all the items on the Service Catalog. Can someone assist suggesting the 'best practice' solution?

Thank you,

Preet Patel

The icon looks like this find_real_file.png.

1 ACCEPTED SOLUTION

Rick Forristall
Tera Guru

Did you ever solve this?

If you're on a portal page, you can add page specific css to hide it.

That element has a class of 'add-on' so in the Portal Page's Page Specific CSS you can add:

.add-on{
	display: none; 
}

find_real_file.png

find_real_file.png

View solution in original post

24 REPLIES 24

Community Alums
Not applicable

@Rick Forristall Found the page and your solution worked! Thank you so much!

Awesome! So glad it helped!!

I hope the rest of your day goes well.


Rick

Robert Duca
Tera Contributor

isn't this solution an all or nothing for the service catalog item page effecting all catalog items and reference fields? In some cases you may want to display this info for some fields and then in other situations  you may not want to... 

Hi @Robert Duca Because this is css on a particular portal page, it would only affect that page and not be global -- it would remove the preview icon for any catalog item being displayed on this "persec_catalog_item" page ... so yes --> any catalog item that is shown using that portal page would have its preview icon removed.

I think, if you need it shown on some catalog items ... you may need a different portal page and direct users to that one?

Another option is possibly to look at the DOM of the catalog item where you don't want the preview icon to appear and possibly DOM-walk using css parent-child relationships to be specific in which preview icon to hide. I mean that if the parent <div id='particular-id'...> element has a particular id you might be able to do something like this:

 

#particular-id > .add-on {
   display: none;
}

Does that make sense?

@Rick Forristall  Yes you validated my assumption here, thanks...  and given that 'most' and most certainly the OOTB /sp portal uses the shared sc_cat_item page to render all catalog items its all or nothing unless you create a custom page for the catalog item itself (with new page routes, etc) but that doesn't help either if only one of the reference variables on the form needs to be hidden. I am considering converting to a lookup select box and then script the mapping to the backend reference variable (this is an idea record producer) to set the value correctly which I was trying to avoid as well. It's a shame there isnt a variable level attribute / boolean that lets you configure this per variable... time to submit an enhancement (idea) i guess šŸ™‚