In order to embed a SharePoint 2013 list or document library into another web application via iframe I had to create a custom master page that is very slick, basically a new minimal master page for list and libraries.
The results looks like this:
The difficult part was to figure out which part (placeholders and other controls) of the original seattle.master which I used as template, I could remove or not.
The results looks like this:
The difficult part was to figure out which part (placeholders and other controls) of the original seattle.master which I used as template, I could remove or not.
<%@Master language="C#"%> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/15/Welcome.ascx" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <SharePoint:SPHtmlTag dir="<%$Resources:wss,multipages_direction_dir_value%>" ID="SPHtmlTag" runat="server" > <head runat="server"> <meta name="GENERATOR" content="Microsoft SharePoint" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=10"/> <meta http-equiv="Expires" content="0" /> <SharePoint:SPPinnedSiteTile runat="server" TileUrl="/_layouts/15/images/SharePointMetroAppTile.png" TileColor="#0072C6" /> <SharePoint:RobotsMetaTag runat="server"/> <SharePoint:PageTitle runat="server"> <asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"> <SharePoint:ProjectProperty Property="Title" runat="server" /> </asp:ContentPlaceHolder> </SharePoint:PageTitle> <SharePoint:SPShortcutIcon runat="server" IconUrl="/_layouts/15/images/favicon.ico?rev=23" /> <SharePoint:StartScript runat="server" /> <SharePoint:CssLink runat="server" Version="15"/> <SharePoint:CacheManifestLink runat="server"/> <SharePoint:ScriptLink language="javascript" name="core.js" OnDemand="true" runat="server" Localizable="false" /> <SharePoint:ScriptLink language="javascript" name="menu.js" OnDemand="true" runat="server" Localizable="false" /> <SharePoint:ScriptLink language="javascript" name="callout.js" OnDemand="true" runat="server" Localizable="false" /> <SharePoint:ScriptLink language="javascript" name="sharing.js" OnDemand="true" runat="server" Localizable="false" /> <SharePoint:ScriptLink language="javascript" name="suitelinks.js" OnDemand="true" runat="server" Localizable="false" /> <SharePoint:CustomJSUrl runat="server" /> <SharePoint:SoapDiscoveryLink runat="server" /> <SharePoint:AjaxDelta id="DeltaPlaceHolderAdditionalPageHead" Container="false" runat="server"> <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" /> <SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true" /> <asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server" /> </SharePoint:AjaxDelta> <SharePoint:CssRegistration Name="Themable/corev15.css" runat="server" /> </head> <body> <SharePoint:ImageLink runat="server"/> <SharePoint:SPNoScript runat="server"/> <SharePoint:SPClientIDGenerator runat="server" ServerControlID="DeltaPlaceHolderMain;DeltaPlaceHolderPageTitleInTitleArea;DeltaPlaceHolderUtilityContent" /> <SharePoint:SharePointForm runat="server" onsubmit="if (typeof(_spFormOnSubmitWrapper) != 'undefined') {return _spFormOnSubmitWrapper();} else {return true;}"> <script type="text/javascript"> var submitHook = function () { return false; }; theForm._spOldSubmit = theForm.submit; theForm.submit = function () { if (!submitHook()) { this._spOldSubmit(); } }; </script> <SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server"> <WebPartPages:SPWebPartManager runat="Server" /> </SharePoint:AjaxDelta> <asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" /> <SharePoint:AjaxDelta id="DeltaDelegateControls" runat="server"> <SharePoint:DelegateControl runat="server" ControlId="GlobalNavigation" /> <SharePoint:DelegateControl ControlId="GlobalSiteLink3" Scope="Farm" runat="server" Visible="false" /> </SharePoint:AjaxDelta> <div id="TurnOnAccessibility" style="display:none" class="s4-notdlg noindex"> <a id="linkTurnOnAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();document.getElementById('linkTurnOffAcc').focus();return false;"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnonaccessibility%>" EncodeMethod="HtmlEncode"/></a> </div> <div id="TurnOffAccessibility" style="display:none" class="s4-notdlg noindex"> <a id="linkTurnOffAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();document.getElementById('linkTurnOnAcc').focus();return false;"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnoffaccessibility%>" EncodeMethod="HtmlEncode"/></a> </div> <div class="s4-notdlg s4-skipribbonshortcut noindex"> <a href="javascript:;" onclick="document.getElementById('startNavigation').focus();" class="ms-accessible ms-acc-button" accesskey="<%$Resources:wss,skipribbon_accesskey%>" runat="server"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,skipRibbonCommandsLink%>" EncodeMethod="HtmlEncode"/></a> </div> <div class="s4-notdlg noindex"> <a href="javascript:;" onclick="document.getElementById('mainContent').focus();" class="ms-accessible ms-acc-button" runat="server"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,mainContentLink%>" EncodeMethod="HtmlEncode"/></a> </div> <div id="TurnOffAnimation" style="display:none;" class="s4-notdlg noindex"> <a id="linkTurnOffAnimation" href="#" class="ms-accessible ms-acc-button" onclick="ToggleAnimationStatus();return false;"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_disableanimation%>" EncodeMethod="HtmlEncode"/></a> </div> <div id="TurnOnAnimation" style="display:none;" class="s4-notdlg noindex"> <a id="linkTurnOnAnimation" href="#" class="ms-accessible ms-acc-button" onclick="ToggleAnimationStatus();return false;"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_enableanimation%>" EncodeMethod="HtmlEncode"/></a> </div> <a id="HiddenAnchor" href="javascript:;" style="display:none;"></a> <div id="ms-hcTest"></div> <div id="s4-ribbonrow" style="display:none"> <div id="globalNavBox" class="noindex"> <div id="ribbonBox"> <div id="s4-ribboncont"> <SharePoint:AjaxDelta id="DeltaSPRibbon" BlockElement="true" runat="server"> <SharePoint:DelegateControl runat="server" ID="GlobalDelegate0" ControlId="GlobalSiteLink0" /> <SharePoint:SPRibbon runat="server" PlaceholderElementId="RibbonContainer" CssFile="" > <SharePoint:SPRibbonPeripheralContent runat="server" CssClass="ms-core-defaultFont ms-dialogHidden" Location="TabRowLeft"> </SharePoint:SPRibbonPeripheralContent> </SharePoint:SPRibbon> </SharePoint:AjaxDelta> </div> <SharePoint:AjaxDelta id="DeltaSPNavigation" runat="server"> <asp:ContentPlaceHolder ID="SPNavigation" runat="server"> <SharePoint:DelegateControl runat="server" ControlId="PublishingConsole" Id="PublishingConsoleDelegate" /> </asp:ContentPlaceHolder> </SharePoint:AjaxDelta> </div> <SharePoint:AjaxDelta id="DeltaWebPartAdderUpdatePanelContainer" BlockElement="true" CssClass="ms-core-webpartadder" runat="server"> <div id="WebPartAdderUpdatePanelContainer"> <asp:UpdatePanel ID="WebPartAdderUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="false" runat="server"> <ContentTemplate> <WebPartPages:WebPartAdder ID="WebPartAdder" runat="server" /> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="WebPartAdder" /> </Triggers> </asp:UpdatePanel> </div> </SharePoint:AjaxDelta> </div> </div> <div id="s4-workspace" class="ms-core-overlay"> <div id="s4-bodyContainer"> <SharePoint:AjaxDelta BlockElement="true" id="DeltaPlaceHolderPageDescription" CssClass="ms-displayInlineBlock ms-normalWrap" runat="server"> <a href="javascript:;" id="ms-pageDescriptionDiv" style="display:none;"> <span id="ms-pageDescriptionImage"> </span> </a> <span class="ms-accessible" id="ms-pageDescription"> <asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat="server" /> </span> <SharePoint:ScriptBlock runat="server"> _spBodyOnLoadFunctionNames.push("setupPageDescriptionCallout"); </SharePoint:ScriptBlock> </SharePoint:AjaxDelta> <div id="contentRow" style="padding-top: 0px"> <SharePoint:AjaxDelta id="DeltaPlaceHolderLeftNavBar" BlockElement="true" CssClass="ms-core-navigation" role="navigation" runat="server"> <asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"> <a id="startNavigation" name="startNavigation" tabIndex="-1"></a> <asp:ContentPlaceHolder id="PlaceHolderLeftNavBarTop" runat="server" /> <asp:ContentPlaceHolder id="PlaceHolderQuickLaunchTop" runat="server" /> <asp:ContentPlaceHolder id="PlaceHolderLeftNavBarDataSource" runat="server" /> <asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat="server" /> <asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat="server" /> </asp:ContentPlaceHolder> </SharePoint:AjaxDelta> <div id="contentBox" aria-live="polite" aria-relevant="all" style="margin-left:1px;min-width:1px"> <div id="notificationArea" class="ms-notif-box"></div> <SharePoint:AjaxDelta id="DeltaPageStatusBar" BlockElement="true" runat="server"> <div id="pageStatusBar"></div> </SharePoint:AjaxDelta> <SharePoint:AjaxDelta id="DeltaPlaceHolderMain" BlockElement="true" IsMainContent="true" runat="server"> <a id="mainContent" name="mainContent" tabindex="-1"></a> <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" /> </SharePoint:AjaxDelta> </div> <SharePoint:AjaxDelta id="DeltaFormDigest" BlockElement="true" runat="server"> <asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server"> <SharePoint:FormDigest runat="server"/> </asp:ContentPlaceHolder> </SharePoint:AjaxDelta> <asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderTitleLeftBorder" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderMiniConsole" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderTitleRightMargin" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderTitleAreaSeparator" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderNavSpacer" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderLeftNavBarBorder" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderBodyLeftBorder" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" runat="server" Visible="false" /> <asp:ContentPlaceHolder id="WSSDesignConsole" runat="server" Visible="false" /> </div> </div> </div> </SharePoint:SharePointForm> <SharePoint:AjaxDelta id="DeltaPlaceHolderUtilityContent" runat="server"> <asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/> </SharePoint:AjaxDelta> <SharePoint:ScriptBlock runat="server"> var g_Workspace = "s4-workspace"; </SharePoint:ScriptBlock> </body> </SharePoint:SPHtmlTag>
Or, you could just append ?IsDlg=1 to the end of your lists pages and SharePoint will display a minimal version for you. No need for master page hacks ;)
ReplyDelete