Home Advanced Request Offering

Hide Page Title

Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭
We have an ARO that is only one page.  Is it possible to hide the page title (and line below) for just this one offering?

Best Answers

  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    Accepted Answer
    Chris,

    Give this a whirl:

    $(document).ready(function () {
    	var url = window.location.href;
    	if(url.indexOf("/ServiceCatalog/RequestOffering/21b6965e-7fa4-5cbd-8f61-6af3ed8df4f0,a058000e-a7ba-e4ec-4a4a-47da4d975d3d") === -1){ // Change to required RO page URL
    		return;
    	}
    	
    	var mainPageNode = document.getElementById('main_wrapper');
    	
    	// create an observer instance
    	var observer = new MutationObserver(function(mutations) {
    		
    		//The page changed. See if our title exists.
    		var titleElement = $('h3:Contains(Page Name)'); // Change to Page Name
    		
            if (titleElement.length > 0) { //An element exists.
    
    			titleElement.hide();
    			
    			//We are done observing.
                observer.disconnect();
            }
    	});
    	
    	// configure the observer and start the instance.
    	var observerConfig = { attributes: true, childList: true, subtree: true, characterData: true };
    	observer.observe(mainPageNode, observerConfig);
    	
    })

    Geoff
  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    Accepted Answer
    Custom.js

Answers

  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    edited November 2016
    Hi Chris,

    Or could be simpler with CSS in this case

    #requestOfferingCont > div.panel > div > article > section > h3 {
    	display:none;
    }

    Geoff
  • Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭
    Hi Chris,

    Or could be simpler with CSS in this case
    Geoff, would this be a global change, or just for this one RO?
  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    Chris, 
    It would effect all AROs with only 1 page. Do you need to do this on just a single ARO?
    Geoff
  • Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭
    Hmm.. Good question.  I guess, ideally, it would be for just this ARO.
  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    Accepted Answer
    Chris,

    Give this a whirl:

    $(document).ready(function () {
    	var url = window.location.href;
    	if(url.indexOf("/ServiceCatalog/RequestOffering/21b6965e-7fa4-5cbd-8f61-6af3ed8df4f0,a058000e-a7ba-e4ec-4a4a-47da4d975d3d") === -1){ // Change to required RO page URL
    		return;
    	}
    	
    	var mainPageNode = document.getElementById('main_wrapper');
    	
    	// create an observer instance
    	var observer = new MutationObserver(function(mutations) {
    		
    		//The page changed. See if our title exists.
    		var titleElement = $('h3:Contains(Page Name)'); // Change to Page Name
    		
            if (titleElement.length > 0) { //An element exists.
    
    			titleElement.hide();
    			
    			//We are done observing.
                observer.disconnect();
            }
    	});
    	
    	// configure the observer and start the instance.
    	var observerConfig = { attributes: true, childList: true, subtree: true, characterData: true };
    	observer.observe(mainPageNode, observerConfig);
    	
    })

    Geoff
  • Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭
    Give this a whirl
    Where am I putting this code.  Not in custom.css, right?
  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    Accepted Answer
    Custom.js
  • Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭
    You are a wizard @Geoff_Ross. Thankfully you use your powers for good and not evil :)
  • Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭
    edited November 2016
    How about hiding the SLA parts of the Service Offering that this ARO is published under, since we are exempting this from SLAs?

    Can those be hidden easily as well?

    EDIT:  Ignore that.  I can just leave those fields blank in the SO via the console and it won't display in the web.


  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    Chris,

    You can just remove it from the SO. Then it won't appear - not even the section title

    If you want to do it per RO then you can use the same as above but change this line.

    var titleElement = $('.ro-so-slo');

    Geoff
  • Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭
    If I omit putting a page title in, will that not be rendered as well, or will I still need your custom script?
  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    I've not tested. You might get a white space which we then can't hide with the script as it needs the name to grab the right element. Give it a go.
    Sometimes the simplest solutions....
  • Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭
    Looks like you still get the divider line if you omit text.  Oh well, it was worth a shot.  Back to enabling the custom script.  Thanks again!
Sign In or Register to comment.