Looking for assistance with customizing the appearance of the icon in the service portal

I have been working on the Servicenow service portal and recently created a custom icon-link widget that displays images as glyph icons.

Although I have almost completed everything, I am facing an issue where my image is not styling correctly compared to the glyph icon.

/* CIRCLE ICON ---------- */

a.circle_icon {
  display: block;
  padding: 20px 0px 20px 70px;
  position: relative;
}

a.circle_icon .fa {
  position:absolute;
  left: 0px;
  top: 10px;
}

/* Image Circle ------- */
a.image_icon {
  display: block;
  padding: 20px 0px 20px 70px;
  position: relative;
}

a.image_icon .fa {
  position:absolute;
  left: 0px;
  top: 10px;
}
 <!--// Circle Icon -->
  <a ng-if="::(options.link_template == 'Circle Icon')" ng-href="{{::data.href}}" class="circle_icon {{::options.class_name}} text-{{::options.color}}" target="{{::data.target}}">
    <span class="fa fa-stack fa-2x">
      <i class="fa fa-circle fa-stack-2x"></i>
      <i class="fa fa-{{::options.glyph}} fa-stack-1x fa-inverse"></i>
    </span>
    <h2>{{::options.title}}</h2>
    <span class="text-muted">{{::options.short_description}}</span>
  </a>
  
   <!--// Image Icon -->
  <a ng-if="::(options.link_template == 'Image Icon')" ng-href="{{::data.href}}" class="image_icon {{::options.class_name}} text-{{::options.color}}" target="{{::data.target}}">
       <span class="fa fa-stack fa-2x">
         <img src="{{data.target}}"/>
        </span>
       <h2>{{::options.title}}</h2>
       <span class="text-muted">{{::options.short_description}}</span>
   </a>
  

When I implement this code, the output appears like this. Click here

The Circle Icon looks perfect out of the box, but the Image icon, which is my custom code, does not match the appearance of the Get Help and Community icons. Specifically, I want the airplane image to resemble those above.

Answer №1

Can I ask you a couple of follow-up questions?

1. What is the specific purpose behind creating a new widget instead of utilizing the Icon link OOB widget that already exists?

I presume you wanted to feature a personalized image rather than the standard bootstrap icon. If so, there's an alternative method available without the need for cloning. By adding a class through page designer and incorporating custom image CSS, you can achieve this effortlessly without cloning.

2. Utilizing the OOB Icon link widget allows customization through instance options. If you have cloned the OOB Icon link widget, you can easily make modifications using instance options.

How can this be accomplished?

  1. Simply right-click on the widget and select instance options.
  2. Scroll down to the bottom where the last field 'Template' offers the option for 'Circle icon'.
  3. Save your changes and you're all set (Please see the attached screenshots below for reference).

https://i.sstatic.net/5MRjs.png https://i.sstatic.net/X235f.png

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The function `angular bootstrap getElementById` is not returning a valid value

I am trying to implement a Bootstrap spinner in Angular before a table is populated, but I am facing an issue where GetElementById in my .ts file is returning a NULL value. Here is the code snippet from my .html and .ts files: .Html code: <div class=& ...

Troubleshooting a problem with the Bootstrap dropdown menu

Can anyone assist with an issue regarding Bootstrap 4.4.1? I am facing a problem where two consecutive dropdown links+menus are not displaying correctly. The second dropdown menu is showing the content of the previous link instead of its own, even though t ...

Perfectly aligning the Update Progress Animation in real-time

I am currently utilizing the Ajax UpdateProgress with a loading gif attached. The issue I am facing is how to ensure that the loading.gif always appears in the center of the screen, even if the user is at the very top or bottom of the page. Is there a meth ...

Errors in AMP Validator

I have recently started working with next/amp and I am encountering some issues with the amp validator in dev mode. The errors that I am struggling to understand are as follows: An error related to CSS syntax in the 'style amp-custom' tag - show ...

Organizing Checkbox Groups for Validation in Bootstrap

My form consists of 2 checkboxes and I only want to submit the form if at least one checkbox is checked. The current code requires both checkboxes to be checked, but I tried grouping them using the name attribute without success. How can I group checkbox ...

How can you incorporate AJAX to add a paragraph element to your HTML document?

I have encountered an issue with two files in my project. The first file is an HTML document, while the second file is a PHP file called ajax_access_database.php. Originally, I intended for the PHP file to access a database, but complications arose, leadin ...

Updating SVG properties using JavaScript does not yield any changes

Currently, I am attempting to adjust the size of an svg tag using javascript in order to make it resizable. Unfortunately, my alterations are not having any effect. The main reason for needing to do this is that the tag is generated by a library that canno ...

Obtain the value of the nth child in jQuery without referencing the HTML tag

I need to work with the number 1.99 in my calculations, but it is preceded by a dollar sign which is subject to change. $(function() { const x = $('#test').text(); console.log(x); console.log(Number(x) + Number(x)); }); <script src="https://cd ...

In Firefox, the width of a CSS grid cell is larger than the actual content it contains

My dilemma involves a div with a height of 15vw and the desire to insert four images into this div (each image's size is 1920*1080 px). When using the code below, everything appears correctly in Chrome. However, in Firefox, each image size is 195*110 ...

The clip-path in Div: Css is malfunctioning and not displaying correctly

I am trying to create a chat bubble using CSS with rounded corners and a bottom-right arrow. However, I am having trouble getting the arrow to display correctly. https://i.stack.imgur.com/gVXOV.png The CSS styling for the chat bubble is as follows: ...

What specific factor is causing the website to be non-responsive?

Upon accessing the following website on a mobile phone or a desktop browser with a minimized window, it is evident that the site is not responsive. Despite my attempts to disable the audio player and adjust the width of the backstretch div, the issue per ...

Update the table contents smoothly using the html helper PagedListPager without having to reload the entire

I am struggling with a specific line of code that utilizes the html helper's PagedListPager: @Html.PagedListPager(Model.kyc_paged_list, page => Url.Action("ClientDetails", new { id = ViewBag.ID, kyc_page = page, transaction_page = Model. ...

Enhancing your design with animated borders on hover

This unique border animation caught my eye and sparked my curiosity. I'm interested to know if it can be achieved using only HTML5/CSS for a hover effect. Have you discovered any other visually appealing hover animations worth mentioning? ...

The navigation menu is obstructing the website content in mobile view

I am facing an issue with the navigation menu on my website. When I switch to mobile resolution to test responsiveness, the menu ends up overlapping the website content. How can I fix this problem? Below is a screenshot of the current situation. Screenshot ...

Is there a way to replace the message 'no rows to show' with a custom component in ag-Grid for react?

Currently, I am utilizing ag-grid in my React application https://www.ag-grid.com. When the table or grid is empty, it displays the default message "No rows to show." However, I am interested in customizing this message or possibly incorporating a custom ...

Enhance React scrollbar functionality without relying on third-party dependencies

Currently working on enhancing the appearance of the scrollbar within my ReactJS project. Specifically, I am aiming for a design similar to this example: https://i.stack.imgur.com/2Q0P4.png Experimented with CSS properties like -webkit-scrollbar, -webki ...

When you hover over the page, the content shifts to reveal a hidden div

Trying to figure out how to show additional content when a photo is hovered over without shifting the rest of the page's content placement? Looking for alternative solutions rather than using margin-top: -22%. Here's a link to the website in que ...

Retrieve the index of the selected element's child node

I need help determining how to identify the position of a specific child element within its parent. For instance, consider the following structure: <parent> <child>a</child> <child>b</child> <child>c</child> ...

When a new VueJS project is created, it failed to automatically install the necessary basic HTML files and folders

Hey there, I am completely new to Vue.js. Just recently, I installed the Vue.js/CLI and created a brand new project using vue create test. This prompted me to choose from three options: > Default ([Vue 2] babel, eslint) Default (Vue 3 Preview) ([Vue 3 ...

Developing a user-friendly widget for a website that is not optimized for mobile devices

Here's the backstory: I'm currently in the process of creating a mobile-friendly widget for my clients. Unfortunately, they have web pages that are not optimized for mobile devices, and it doesn't seem like that will change anytime soon. Th ...