How to take custom icons in Service Portal if relevant Glyph is not present ?

Apurv Kumar
Tera Expert

I want to add a custom icon from db_image table into service portal for which i created an instance option "image" and i am able to select the image. All i need is to select the icon if glyph is not selected in the service portal instance and it is selected in the image in the option. Kindly help me with HTML code snippet to add the icon from the image table if glyph is not present.

 

5 REPLIES 5

Harish KM
Kilo Patron
Kilo Patron

Hi your image is broken. you can do like this in HTML widget

 <div class="test" >
            <span class="circle-span">
              <img src="filename.png">// file name from image table
            </span>
            <div >

Regards
Harish

I cannot hardcode the file name as I have to take different images from the table because i have reused same OOB widget several times in the portal.

Mohith Devatte
Tera Sage
Tera Sage

hello @Apurv Kumar ,

i think you must have a variable in server side call options.glyph.

Check like this 

data.showImage= false;

if(options.glyph=='')

{
data.showImage=true;
}
else
{
data.showImage=false;
}

put this is server script 

and in HTML you can check like below 

<div ng-if="data.showImage==true">
<img src="your file name what you have save in db_image table"/>
</div>

please mark my answer correct if it helps you

 

 

I cannot hardcode the file name as I have to take different images from the table because i have reused same OOB widget several times in the portal.