Solved

SharePoint Add-in: Get Rid of Microsoft Header

Posted on 2016-07-25
2
76 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 9

Accepted Solution

by:
Paweł earned 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

734 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