Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SharePoint Add-in: Get Rid of Microsoft Header

Posted on 2016-07-25
2
Medium Priority
?
112 Views
Last Modified: 2016-07-25
I'm developing a SharePoint add-in with Visual Studio 2015 using JavaScript and want to remove the default headers/navigation Microsoft includes, specifically what's in the red box:

SP Add-In Default Header
I assume these are included via the default .aspx code which looks like:

<%-- The following 4 lines are ASP.NET directives needed when using SharePoint components --%>

<%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %>

<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Open in new window


But I can't wholesale delete those lines without generating a page that simply doesn't run (error is 'An unexpected error has occurred').

What's the correct way to customize?

Thanks!

Michael
0
Comment
Question by:Michael Vasilevsky
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Paweł earned 2000 total points
ID: 41727677
what you'll have to do is use CSS to hide it from the UI rather then remove it, now your sharepoint add in runs in an iFrame so i don't think you'll be able to it there without the iFrame trick (https://github.com/InstanceOfAnObject/IFrameOrchestrator) there I believe you'll be able to fire javascript from your add in into the host web that will then be able to update the css of your host page.

that or I think you can inject it into the page using the Script Editor webpart
https://sharepoint.protiviti.com/blog/Lists/Posts/Post.aspx?ID=169

with both you'll have to find the selector for the css container of what you want to hide
0
 
LVL 10

Author Comment

by:Michael Vasilevsky
ID: 41728848
I suspected using CSS to hide is the approach - thanks for the info. Below is the CSS I added for anyone interested:

#globalNavBox {
    display: none !important;
}

#suiteBarDelta {
    display: none !important;
}

Open in new window


Thank you!

Michael
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question