Thursday, June 28, 2012

Hide something from the SharePoint Dialog Box

Today I went onto a SharePoint site to Upload A file and saw this in the Dialog Box to upload a file.

Notice the Support Div That is floating on the Right of the page but then is also on the Dialog Box.


SharePoint uses the same Master Page for Dialog Boxes as it does for your site so if you add something to the master page it will most likely show up in your dialog boxes as well.


To resolve this issue you need to know about a "special" CSS class SharePoint uses.


It is s4-notdlg Any item in the master page that has this class is stripped out of the dialog boxes automatically by SharePoint.


So instead of like this:

 <div title="Support" class="supportTab " id="supportTab">  
 Support  
 </div>  

It should be like this:

 <div title="Support" class="supportTab s4-notdlg" id="supportTab">  
 Support  
 </div>  

Extra credit if you add the noindex so search doesn't find the word Support on every page in your Site:

 <div title="Support" class="supportTab s4-notdlg noindex" id="supportTab">  
 Support  
 </div>  

No comments:

Post a Comment