I am trying to push the page layouts(html page layouts) from SharePoint hosted app to host web. I am able to push the html page layout. My intention is to create a page dynamically by attaching this newly pushed page layout. I think when we create a page, it is expecting .aspx page layout needs to be presented. But, unfortunately when page is being created, .aspx page layout is not ready(which should come from html page layout). Is there a way to say convert this html page layout immediately to aspx page layout using JSOM? But If i wait for, 5-10mins, then .aspx page layout is getting created with html page layout

  • I'm not sure how the .aspx is generated for the associated .html, but you probably don't want to implement your own script to generate it, as you'd have to deal with the process running in the background which would anyway generate the file. => Find out what's generating the .aspx (e.g. a timer job), and how you could change its run interval. Or (much less seriously), create a script which makes your browser sleep for 10 mins when the html is uploaded. – moe Jul 21 '17 at 12:03
  • .aspx will generate if .html file presented for pagelayout with html pagelayout content type. But keeping browser sleep for 10mins may not be correct i think. – Mihir Jul 21 '17 at 13:18

Nope, you can't trigger the process or speed it up. There's an event receiver on the master page gallery that performs the conversion. That said, 5-10 minutes seems like a really long time.

One workaround I can suggest is to forget about HTML page layouts (they suck anyway) and just push the page layout as an *.aspx directly. Then you won't have to wait for the backend process.

| improve this answer | |
  • That true, I have tried with that option also, but problem is, .aspx file is uploading as design file. So while creating the page that is not a pagelayout. So it is failing. – Mihir Jul 21 '17 at 13:17
  • You need to set the content type to Page Layout – Derek Gusoff Jul 21 '17 at 14:15
  • Is it possible to update content type while uploading pagelayout? I guess once pagelayout got uploaded then we need to get the same item properties and update the content type. isn't it? – Mihir Jul 21 '17 at 14:26
  • Yes, you need to fetch the list item after upload and update the CT. – Derek Gusoff Jul 21 '17 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.