Keep custom headers, footers, CSS, etc. from loading in SharePoint modal dialogs

This article was originally published on September 4, 2017. Product interfaces and features may have changed.

modalfooter

When writing your own custom headers and footers, you probably don’t want/need that script showing in modal dialog windows too. It can look sloppy or accidental and may wrap oddly, as seen in my example above.

Luckily, it’s an easy fix.

  1. Open your master page for editing (or wherever you’re placing your custom script).
  2. Find your custom divs (in my example, footer-fixed)
  3. Add class=”ms-dialogHidden” after the div id
    dialoghidden.PNG
  4. Repeat steps 2 & 3 for each custom div you’ve written that you want to keep from showing up in modal dialogs

Save/publish your changes. Good luck!

Preserved with its original publication date.