1

I'm just curious in case we can modify or remove the global header section from a lightning app page.

Does anyone have any pointer for tweaking this section?

Lightning Page Header

3

I don't believe so - as mentioned here

The functionality in the header is applicable across all contexts in the Salesforce ecosystem (internal or 3rd party).

0

Well the solution that seems a fit here is as follows:

Define a renderer for a custom component included in the Lightning page, and override the page rendering process by removing or making the specific class non-visible:

({
// Your renderer method overrides go here
afterRender: function (component, helper) {
    this.superAfterRender();
    // interact with the DOM here       

    //Full Header
    //document.getElementsByClassName('slds-grid--align-spread')[1].style.display='none';

    //Search Bar
    document.getElementsByClassName('slds-global-header__item--search')[1].style.display='none';
}    })  

Please note that this workaround would work if Locker service is not enabled in your Org.

0

Please find another workaround for modifying ‘Global Header’ of lightning pages:

  1. Create an external CSS file with the following snippets: // This is to remove search box of the header // Add other required slds classes as required

    .slds-global-header__item--search{ display: none; }

  2. Include this file as a Static resource in a custom lightning component of the page:

    <ltng:require styles="{!$Resource.Global_Search_Hide}" />

  3. Refresh your page

This solution should be working irrespective of Locker Service enablement in your Org.

  • You could have updated your answer; instead of adding a new one. This still seems a hack instead of correct solution. – Raul Sep 14 '17 at 15:53
  • @Rahul Sharma, yes that's correct, it's a work around. – sIQh Sep 15 '17 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.