Cireson Partners, Customers and Community members share your customizations and examples here to help benefit the community as a whole to earn Kudos and badges.
DISCLAIMER
All files and projects located here are provided and come "as-is" and without any warranty or support. Use at your own risk. Your use of Community Uploads is subject to our Terms of Use.
Cireson does not and will not support or maintain these enhancements, extensions, and scripts.
For Team Cireson uploads click here.
Service Catalog Layout Option based on Service Offering
I created a working proof of concept for just this type of functionality. To implement, just place the following code in your custom.js file. You will need to update the guid of your home page view, as indicated in the script, and then place a .png named with the guid of each of your service offerings in the "C:\Inetpub\ciresonportal\Images" folder. You can easily discover the guid of your service offerings in the Service Manager Console, or by using the developer tools to view the data-service attribute of the <div> for each service offering. I also have an alternative version which reads the base64 image data that is attached to the Service Offering in the SCSM Console, which is below the first example.
Note that in the code we are using some Timeouts to wait for specific elements to become available, as we are not modifying any existing code to raise additional events.
Code: (sorry about formatting, it looks great in edit view!)
Alternate version, which uses the icon attached to the service offering:
Comments
2 issues came up when I tried this solution. First IE11 interrupts and second if I clicked breadcrumb or sidebarmenu, the SO icons were replaced again with the RO icons. Thats why I changed it to:
[code]
$( document ).ready(function() {
SetServiceOfferingImages();
waitForEl("#service-catalog",function(){
$("#service-catalog").on("click", SetServiceOfferingImages);
});
});
var waitForEl = function(selector, callback) {
if (jQuery(selector).length) {
callback();
} else {
setTimeout(function() {
waitForEl(selector, callback);
}, 100);
}
};
function SetServiceOfferingImages(){
waitForEl("div.so-blocks",function(){
var offeringImageBlock = $("div.so-blocks");
if (offeringImageBlock.length > 0) {
$.each(offeringImageBlock, function (index, value) {
var soId = $(this).attr('data-service');
$(this).empty();
$(this).prepend('<img src="/ServiceCatalog/GetServiceOfferingImg/' + soId + '" style="width:154px;height:125px !important;"/>');
$(this).click(function () {
$('span.link[data-service="' + soId + '"]').click();
});
});
}
});
}
[/code]