Jun 16 2020 09:15 AM
I am looking for a way to either open the new page menu at the 'news post' pane, or create a new news post page (or page of a certain template) completely, by the click of a button. This is with a view to helping less technical members of staff create pages to use it as blog functionality.
Is there a URL that can be obtained for a new page that can be assigned to a button for example?
Jun 16 2020 09:44 AM
@Mark WhitfieldYou can use something like this, but then it creates with default template.
https://youtenant.sharepoint.com/sites/siteName/_layouts/15/CreateSitePage.aspx?source=%2Fsites%2FsiteName&promotedState=1&Mode=Edit
Thanks,
Vik
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Jun 16 2020 03:01 PM
@Vikram_Samal Hi Vikram, that is along the lines of what I am looking for, however I am trying to do this but to create a new page using a template, rather than the default.
Do you know if this is achievable.
Jun 17 2020 01:19 PM
@Mark WhitfieldI wish i could have anything more as I still looking for some better solution and checking in fiddler if I can find any other details. I will keep you posted on this.
Thanks
Vik
Mar 02 2021 11:33 AM
@Mark Whitfield This would be so useful! Did anyone ever find a way to do it?
Apr 26 2022 11:39 AM - edited Apr 26 2022 11:47 AM
Hello, I ended up with a similar situation and ended up using power apps with a power flow to create the buttons.
The first difficulty was the call to create a page from a template is a post request.
That ruled out a simple redirect.
In powerapps you can create a button with a function like this
Set(flowResponse,'Http->SendanHTTPrequesttoSharePoint'.Run("25"))
; Launch(flowResponse.url);
SendanHTTPrequesttoSharepoint is the flow the .Run("25") is the page number of the template i want to use.
To get the pages number I used chromes debug to watch the network call for (CopyWithConfiguration) that has the page number in the request.
In power automate you can use the SharePint api object to create the page :
The whole flow looks like this :
The URL is the link back to your new page that powerapps will Launch.
Hope this helps.
PS: I also believe this is automatable with the sharepoint api to automatically grab the templates you want but this should get you started.
Heres a sample of the result with 2 button to create pages :