sitecoresitecore-mvcsitecore-sxa

Layout not found when adding querystring p=1


I'm trying to create a printer friendly version of a Sitecore page.The first thing I do is add layout for the print device by clicking the "copy to" from the default layout. The layout and all the rendering are copied successfully to the print device. After this, I published the page.

What I am expecting is that, when I add p=1 querystring to the url of the page, it will display the same as the default layout (this is for testing purposes only). But instead, Sitecore encounters an error saying:

> The layout for the requested document was not found 
> Requested URL:    URL Of The Page
> Requested Layout: {00000000-0000-0000-0000-000000000000} 
> Requested Device: Print

Note: SXA is installed to my Sitecore instance

Please let me know what I am missing.

I am using Sitecore 9 by the way.


Solution

  • Did you publish layout and device? I had similar error when layout wasn't published. The easiest (and the most reliable) way to check is it published is to switch to web DB and check is layout and device are there in content tree.