{"componentChunkName":"component---src-templates-post-template-jsx","path":"/2020-04-29-headerlesssearchresults-cant-show-this-page-with-its-current-layout","result":{"data":{"markdownRemark":{"html":"<p>I'm configuring a custom search results page in a test environment and one of the things we can customize is the layout for our new results page, to get rid of all the chrome. To do this, we can use the <a href=\"https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps\">SharePointPnPPowerShellOnline</a> PowerShell module, in particular the <code class=\"language-text\">Set-PnPClientSidePage</code> command, as follows (Results.aspx is of course the test results page I created):</p>\n<p><code class=\"language-text\">Set-PnPClientSidePage -Identity &quot;Results.aspx&quot; -LayoutType HeaderlessSearchResults</code></p>\n<p>However, when I run the command (which runs without error) and visit the page, I get the following error screen:</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n    <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 55.99999999999999%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAACE3AAAhNwEzWJ96AAAA4UlEQVQoz61SBw6DMAzM/x+JxJZAjIQ9r5wZQlVb1FJLp8SDw+dY4c+mhmGAMQZ1XaNpGtAvy1LAeJqmKIpC8l3XoaqqI896+kTbtpjneSX0PA9xHMP3feiFhH4QBHBdVxCGoZxRFMGyLLknSQLHcaSOsG0b4zhCTdMk7CTmH3kn+r7fMEiOXbDDd8aaTXIPrbXIosRiQZZlyPNcfGPWOH3KpFHaM/a4+nbor8jOUNTNDrU2crKjTx9evjKLSHoG5/or1LMc2i1Cvg5XgPtGydly3lrsfW2OVVlWg41eDf8dHvsRX3EpsMXUAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"SharePoint Error Page\"\n        title=\"SharePoint Error Page\"\n        src=\"/static/b633e65d964833c6021b481c9e49f626/78d47/SPErrorPage.png\"\n        srcset=\"/static/b633e65d964833c6021b481c9e49f626/56d15/SPErrorPage.png 200w,\n/static/b633e65d964833c6021b481c9e49f626/d9f49/SPErrorPage.png 400w,\n/static/b633e65d964833c6021b481c9e49f626/78d47/SPErrorPage.png 800w,\n/static/b633e65d964833c6021b481c9e49f626/3fa5a/SPErrorPage.png 1107w\"\n        sizes=\"(max-width: 800px) 100vw, 800px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span>\n    <figcaption class=\"gatsby-resp-image-figcaption\">SharePoint Error Page</figcaption>\n  </figure></p>\n<p>Now, I didn't immediately recognise this 'We can't show this page with its current layout' eror, and I really didn't want to log a call to Microsoft for this with that correlation id, as this seemed much easier to solve, so I started with some web searching, but found nothing under the error text itself, so I started broadening my search and looked for 'HeaderlessSearchResults' instead. When I did so, this <a href=\"https://github.com/SharePoint/sp-dev-docs/issues/5103#issuecomment-572675242\">link to the SharePoint dev docs</a> on GitHub came up, and inside @PatMill suggested trying to search the source code in the page for that error. When I visit my original page, however, it immediately redirects to the Error page, much as Sébastien pointed out in the next comment.</p>\n<p>So, time to fire up Fiddler! I did so, and in the html for my original page, I see a reference to the following js file:\n<a href=\"https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_10d7ceae66a795bc8885e8d62ac8b0bb.js\">https://spoprod-a.akamaihd.net/files/sp-client/sp-pages-assembly_en-us_10d7ceae66a795bc8885e8d62ac8b0bb.js</a></p>\n<p>Inside this file, when I did a search for 'We can't show this page with its current layout', I find the following object:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">\t{\n\t\tunsupportedScenarioTitle:&quot;We can&#39;t show this page with its current layout&quot;,\n\t\tunsupportedScenarioDescription:&quot;This page has a layout that only works when it is used as a search results page. To set this page as the search results page, go to Search Settings for this site collection, and set this page as the Results Page URL. You can also change its layout back to another one that&#39;s supported to view it.&quot;\n\t}</code></pre></div>\n<p>And bingo I have an error I can work with! It turns out I hadn't set this page as the Search Results page for anyone yet. If I do so in the demo site I'm using, it works!</p>\n<p>To do this, go to the site settings, then \"Search Settings\" (in this case I want it to apply to the entire site collection, so I go to the \"Search Settings\" inside the Site Collection Administration section) and I set my page as the Search Results page, as follows:</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n    <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 28.500000000000004%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAACE3AAAhNwEzWJ96AAAAsUlEQVQY03WQbQ/CIAyE+f9/dB+UWWiBsbe6q4I6syZPCoReL+eYo+acjZSSiiTrDbxf1b7vPx3lQmQFImKUUnSapg7utVad51mXZems6/onZoK3MWrgbAPfg+jtjEXMbOIArtG3beuiDedJdDxAJz5c1df2BoYgSA/SEIKBRVflIovlJsjsvRkO4BbuIEhEOgyDeu/V373GGPs/gAX4BxyGzjmcC05bJA3LuHwybnE9AeJ71bY8Qv63AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"SharePoint Search Settings Page\"\n        title=\"SharePoint Search Settings Page\"\n        src=\"/static/27d87e7572c198ff2002eb0d77cd26a5/78d47/SiteCollectionAdminSettings.png\"\n        srcset=\"/static/27d87e7572c198ff2002eb0d77cd26a5/56d15/SiteCollectionAdminSettings.png 200w,\n/static/27d87e7572c198ff2002eb0d77cd26a5/d9f49/SiteCollectionAdminSettings.png 400w,\n/static/27d87e7572c198ff2002eb0d77cd26a5/78d47/SiteCollectionAdminSettings.png 800w,\n/static/27d87e7572c198ff2002eb0d77cd26a5/64756/SiteCollectionAdminSettings.png 1200w,\n/static/27d87e7572c198ff2002eb0d77cd26a5/60b6f/SiteCollectionAdminSettings.png 1494w\"\n        sizes=\"(max-width: 800px) 100vw, 800px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span>\n    <figcaption class=\"gatsby-resp-image-figcaption\">SharePoint Search Settings Page</figcaption>\n  </figure></p>\n<p>When I hit the Save button and refresh my page, it's working as per below:</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n    <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 50%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAACE3AAAhNwEzWJ96AAABW0lEQVQoz61Ru0oDQRTdf/MbLK3EQrDyAywsJIUKJr4wvogEEW21ECzEQrAURPAL1MQkk5ndndmdmeO9Q9bsLjaCB04xc5/n3Gir3cXu6QUa28dotP5IqllrHmF1Yw8r6weYWWwhwj8hNh7XzwpRbi201jDGwGQZLL2Z/J/nJdopKzlE7xxinWEgDTXMc0gp4SjACMmUUIf3PpDhnEecpODaIlYgymgr7x3uHh5xeHaFJElCotYGIyFomMKYBvJfUWitw2AowLXlYcyIpTKa7Q5m55ehVByKHW1pS/KqG7owOCWrsmw6KDSM6fNLSPQHAu+f/eBn2HAsoA0n/yaZPIvjYFVZdmjIfgmZIklNJaDJZCFpi1RXpBUNlVKBbuJ3EYvYPyXHSEkCB/mijFHvA8N+L2xiJwcrS6sf7Efyy+sbupc3uL1/wv7JOeYWlrDZ3AkJLKfuY/3q9SHfZU3wuOjYNXEAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"SharePoint Search Results Page - Working\"\n        title=\"SharePoint Search Results Page - Working\"\n        src=\"/static/e5952e3c406d5fd04c3c5ea6444f7c41/78d47/SearchResultsWorking.png\"\n        srcset=\"/static/e5952e3c406d5fd04c3c5ea6444f7c41/56d15/SearchResultsWorking.png 200w,\n/static/e5952e3c406d5fd04c3c5ea6444f7c41/d9f49/SearchResultsWorking.png 400w,\n/static/e5952e3c406d5fd04c3c5ea6444f7c41/78d47/SearchResultsWorking.png 800w,\n/static/e5952e3c406d5fd04c3c5ea6444f7c41/64756/SearchResultsWorking.png 1200w,\n/static/e5952e3c406d5fd04c3c5ea6444f7c41/68934/SearchResultsWorking.png 1278w\"\n        sizes=\"(max-width: 800px) 100vw, 800px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span>\n    <figcaption class=\"gatsby-resp-image-figcaption\">SharePoint Search Results Page - Working</figcaption>\n  </figure></p>\n<p>Hope that helps someone with the same issue.</p>","timeToRead":2,"excerpt":"I'm configuring a custom search results page in a test environment and one of the things we can customize is the layout for our new results…","frontmatter":{"title":"Custom SharePoint Online Search Results Error - HeaderlessSearchResults Error - 'We can't show this page with its current layout'","date":"2020-04-29T07:00:00Z","categories":["development"],"tags":["dev","sharepoint","office365","help","search"],"description":"Resolves this error when setting the HeaderlessSearchResults layout page type","keywords":"SharePoint, Search, Microsoft","cover":{"childImageSharp":{"fixed":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAMFAgT/xAAVAQEBAAAAAAAAAAAAAAAAAAABAv/aAAwDAQACEAMQAAABrp6cFNJAz//EABsQAAEEAwAAAAAAAAAAAAAAAAIAAQMSBCJB/9oACAEBAAEFAjKrNLsuVZS5Bwn/AP/EABYRAQEBAAAAAAAAAAAAAAAAAAEQEf/aAAgBAwEBPwETJ//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABoQAAICAwAAAAAAAAAAAAAAAAABERIgImH/2gAIAQEABj8CkWFHt0//xAAcEAADAAIDAQAAAAAAAAAAAAAAAREhMUFRYXH/2gAIAQEAAT8hlehLRNubosjU7Dcq7Zjw4Ufg/9oADAMBAAIAAwAAABBoD//EABcRAQADAAAAAAAAAAAAAAAAAAEQESH/2gAIAQMBAT8QDRNj/8QAFhEBAQEAAAAAAAAAAAAAAAAAARAR/9oACAECAQE/EEdn/8QAHBABAAIDAAMAAAAAAAAAAAAAAQARITFhUZGh/9oACAEBAAE/EHcBUGHWPUIKoljt4qCl19hJdjdMudQrDT0diCpER5p0ML3E/9k=","width":660,"height":442,"src":"/static/b777297c5cfe396d30aed42391ff75b9/105fa/ErrorMessage.jpg","srcSet":"/static/b777297c5cfe396d30aed42391ff75b9/105fa/ErrorMessage.jpg 1x,\n/static/b777297c5cfe396d30aed42391ff75b9/06791/ErrorMessage.jpg 1.5x,\n/static/b777297c5cfe396d30aed42391ff75b9/d039f/ErrorMessage.jpg 2x"}}}},"fields":{"slug":"/2020-04-29-headerlesssearchresults-cant-show-this-page-with-its-current-layout","date":"2020-04-29T07:00:00.000Z"}}},"pageContext":{"slug":"/2020-04-29-headerlesssearchresults-cant-show-this-page-with-its-current-layout","nexttitle":"Teams Bot Issue - Multiple (Repeated) ConversationUpdate/MembersAdded Messages","nextslug":"/2020-02-13-multiple-repeated-members-added-in-teams","prevtitle":"[WEBINAR] How Bots in Teams Can Drive Collaboration & Increase User Adoption","prevslug":"/2020-11-15-webcast-bots-drive-collaboration","tagList":["viva","connections","dev","sharepoint","teams","office365","search","adoption","collaboration","bots","help","bugs"],"categoryList":["development","poweruser","training","personal"],"latestPostEdges":[{"node":{"fields":{"slug":"/2021-04-12-viva-connections-custom-search"},"frontmatter":{"template":"post","title":"Using a Custom Search Page in Microsoft Viva Connections","tags":["viva","connections","dev","sharepoint","teams","office365","search"],"categories":["development","poweruser"],"date":"2021-04-12T07:00:00Z"}}},{"node":{"fields":{"slug":"/2021-04-05-viva-connections-different-sites-for-different-users"},"frontmatter":{"template":"post","title":"Setting Different Sites for Different Users in Microsoft Viva Connections","tags":["viva","connections","dev","sharepoint","teams","office365"],"categories":["development","poweruser"],"date":"2021-04-05T07:00:00Z"}}},{"node":{"fields":{"slug":"/2021-04-01-different-ways-of-creating-the-viva-connections-app-package"},"frontmatter":{"template":"post","title":"A Different Way to Create the Microsoft Viva Connections App Package","tags":["viva","connections","dev","sharepoint","teams","office365"],"categories":["development","poweruser"],"date":"2021-04-01T07:00:00Z"}}},{"node":{"fields":{"slug":"/2021-03-31-understanding-viva-connections-app-package"},"frontmatter":{"template":"post","title":"Understanding the Microsoft Viva Connections App Package","tags":["viva","connections","dev","sharepoint","teams","office365"],"categories":["development","poweruser"],"date":"2021-03-31T07:00:00Z"}}},{"node":{"fields":{"slug":"/2021-02-18-podcast-building-teams-apps"},"frontmatter":{"template":"post","title":"[PODCAST] Building Apps for Microsoft Teams on DotNetRocks","tags":["dev","sharepoint","teams","office365","adoption","collaboration","bots"],"categories":["development","poweruser","training"],"date":"2021-02-18T07:00:00Z"}}},{"node":{"fields":{"slug":"/2020-11-15-webcast-bots-drive-collaboration"},"frontmatter":{"template":"post","title":"[WEBINAR] How Bots in Teams Can Drive Collaboration & Increase User Adoption","tags":["dev","sharepoint","teams","office365","adoption","collaboration","bots"],"categories":["development","poweruser","training"],"date":"2020-11-15T07:00:00Z"}}},{"node":{"fields":{"slug":"/2020-04-29-headerlesssearchresults-cant-show-this-page-with-its-current-layout"},"frontmatter":{"template":"post","title":"Custom SharePoint Online Search Results Error - HeaderlessSearchResults Error - 'We can't show this page with its current layout'","tags":["dev","sharepoint","office365","help","search"],"categories":["development"],"date":"2020-04-29T07:00:00Z"}}},{"node":{"fields":{"slug":"/2020-02-13-multiple-repeated-members-added-in-teams"},"frontmatter":{"template":"post","title":"Teams Bot Issue - Multiple (Repeated) ConversationUpdate/MembersAdded Messages","tags":["dev","teams","bots","bugs"],"categories":["development"],"date":"2020-02-13T19:00:00Z"}}}]}},"staticQueryHashes":[]}