I had this issue for quite sometime with a SharePoint Online project I was working on. I use Design Manager to create a new layout page and add snippets to the html layout. I would create webpart zones, add my webpart snippets on to the html, save and publish but the resulting aspx page wouldn't have any of my webparts in it.
I checked it from SPD 2013 and everything looks perfect, I can see all the code snippets in there. It was really strange and I had no clues.
I had some content search webparts in the layout and one content editor webpart with a link to a text file with some css in it. After countless hours on the internet I read about few other people having similar issues when they had custom css on the layout pages to hide quick launch.
I tried removing my content editor webpart and everything seems to be normal. A new page created using the layout had all the webparts in it and even the layout preview was displaying fine.
I needed this css somewhere on the page and getting that was tricky because you cannot just apply css styles inline on the page. The trick is to use the Design Manager syntax for css which is this:
<!--MS:<style type="text/css">-->
<!--ME: </style>-->
The above code for me was within the closing <!--ME:</asp:ContentPlaceHolder>-->
Once I changed my layout with styles enclosed as shown above everything was working as expected.
Another thing that may help while working with page layouts is that if you want to reuse MS css for the DIV to contain your webpart zones you may have to use the following style sheet in your page layout:
<!--CS: Start Edit Mode Panel Snippet-->
<link href="https://yourtenant.sharepoint.com/sites/iss/Style%20Library/en-us/Themable/Core%20Styles/pagelayouts15.css" rel="stylesheet" type="text/css" ms-design-css-conversion="no" />
What may also help is deleting and recreating the page layout.
PS: You do not have to use CDATA tags for your css.
I checked it from SPD 2013 and everything looks perfect, I can see all the code snippets in there. It was really strange and I had no clues.
I had some content search webparts in the layout and one content editor webpart with a link to a text file with some css in it. After countless hours on the internet I read about few other people having similar issues when they had custom css on the layout pages to hide quick launch.
I tried removing my content editor webpart and everything seems to be normal. A new page created using the layout had all the webparts in it and even the layout preview was displaying fine.
I needed this css somewhere on the page and getting that was tricky because you cannot just apply css styles inline on the page. The trick is to use the Design Manager syntax for css which is this:
<!--MS:<style type="text/css">-->
<!--ME: </style>-->
The above code for me was within the closing <!--ME:</asp:ContentPlaceHolder>-->
Once I changed my layout with styles enclosed as shown above everything was working as expected.
Another thing that may help while working with page layouts is that if you want to reuse MS css for the DIV to contain your webpart zones you may have to use the following style sheet in your page layout:
<!--CS: Start Edit Mode Panel Snippet-->
<link href="https://yourtenant.sharepoint.com/sites/iss/Style%20Library/en-us/Themable/Core%20Styles/pagelayouts15.css" rel="stylesheet" type="text/css" ms-design-css-conversion="no" />
What may also help is deleting and recreating the page layout.
PS: You do not have to use CDATA tags for your css.
Comments