Home Analyst Portal

Add custom logo to Alternate view home page

Dave_MasemanDave_Maseman Customer IT Monkey ✭
Does anyone have the CSS code to do this?  I would like to add our corporate logo as a JPG to the main page.

Comments

  • joivan_hedrickjoivan_hedrick Cireson Consultant Advanced IT Monkey ✭✭✭
    Are you looking to add it to the page header? Next to the page "Home" title? Or elsewhere?
  • Dave_MasemanDave_Maseman Customer IT Monkey ✭
    Either next to the home title or replacing the home title.
  • joivan_hedrickjoivan_hedrick Cireson Consultant Advanced IT Monkey ✭✭✭
    Are you opposed to using JavaScript? While you could use CSS to modify the title, it would do so on all pages. The js below will only affect the Home title on the Home Alternative screen.

    $(document).ready(function(){
        if (document.URL.indexOf("/View/02efdc70-55c7-4ba8-9804-ca01631c1a54") === -1) {
            //Ignore all other pages except for the Team Requests page.
            return; 
        }
        
        var mainPageNode = document.getElementById('main_wrapper');
        // create an observer instance that runs whenever the page changes. Wait for our page title to exist.
        var observer = new MutationObserver(function(mutations) {
            //The page changed. See if the page title exists yet.
            var elementToWatchFor = $(".page_title");
            if (elementToWatchFor.length > 0) {
                //An element with class of page_title exists.
                var titleElement = $("h1.page_title:contains('Home')");
                titleElement.hide();
                titleElement.parent().append("<img src='/images/about_black.png' alt='home_img'>");
                observer.disconnect();
            }
        });
         
        // Configure the observer.
        var observerConfig = { attributes: true, childList: true, subtree: true, characterData: true };
         
        // pass in the node, and our mutationobserver options.
        observer.observe(mainPageNode, observerConfig);
    });


  • Dave_MasemanDave_Maseman Customer IT Monkey ✭
    This worked perfectly.  Thanks for your help.
  • Bernics_GaborBernics_Gabor Member IT Monkey ✭
    Hi Guys,

    How can i inject this (or another JS or HTML) code to the Service Request "main" page?

    Regards,
    Gabor
  • joivan_hedrickjoivan_hedrick Cireson Consultant Advanced IT Monkey ✭✭✭
    The code above will change the title of whichever page is specified in the URL. The example uses the line 
    if (document.URL.indexOf("/View/<b>02efdc70-55c7-4ba8-9804-ca01631c1a54</b>") === -1)
    So you would need to change this URL to be the URL that you would like. Afterwards, you'll need to paste the entire code block into your custom.js file.
Sign In or Register to comment.