Layout not found when adding querystring p=1

455 Views Asked by At

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.

2

There are 2 best solutions below

1
On BEST ANSWER

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.

0
On

A bit late for an answer perhaps, but this behavior is intended. The 'Print' device uses the querystring p=1 to display the Print layout. Thing I did to change this behavior is change the 'p=1' to 'print=1' for the print layout.

So, I guess this should be the correct answer ;)!