0

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

2
  • 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, 2017 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, 2017 at 13:18

1 Answer 1

1

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.

4
  • 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, 2017 at 13:17
  • You need to set the content type to Page Layout Jul 21, 2017 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, 2017 at 14:26
  • Yes, you need to fetch the list item after upload and update the CT. Jul 21, 2017 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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