Forum Discussion

THOREX's avatar
THOREX
Copper Contributor
Feb 28, 2023
Solved

Create a button with new news post linked to templates

Hi,

On a SharePoint online site I want to restrict users to the menu of creating new pages, lists, librarys etc.

Instead I want to create a button with "create news post".

I tried the: https://tenantname.sharepoint.com/sites/SiteName/_layouts/15/CreatePageFromTemplate.aspx but this only creates a new page not a new news post.

I don't want a new page since I afterwards when i publish I get a pop-up with "help others find you page". I dont want that.

 

Also, what permissions should I use at the site to restrict users to not seeing the menu but being able with the button to see the own-created templates, not only the build in templates.

  • THOREX Use link in below format to create a new news post: 

     

    https://contoso.sharepoint.com/sites/siteName/_layouts/15/CreatePageFromTemplate.aspx?source=/sites/siteName/&promotedState=1

     

    Also, you can hide New option in site pages library using JSON view formatting: 

     

    {
      "commandBarProps": {
        "commands": [
          {
            "key": "new",
            "hide": true
          }
        ]
      }
    }

     

    Output

    DocumentationCommand bar customization syntax reference 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

  • THOREX Use link in below format to create a new news post: 

     

    https://contoso.sharepoint.com/sites/siteName/_layouts/15/CreatePageFromTemplate.aspx?source=/sites/siteName/&promotedState=1

     

    Also, you can hide New option in site pages library using JSON view formatting: 

     

    {
      "commandBarProps": {
        "commands": [
          {
            "key": "new",
            "hide": true
          }
        ]
      }
    }

     

    Output

    DocumentationCommand bar customization syntax reference 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

    • AndyO1375's avatar
      AndyO1375
      Copper Contributor
      Wow thanks a million. I have searched for this createpagefromtemplate.apx option for a long long time.
    • THOREX's avatar
      THOREX
      Copper Contributor
      Thanks Jennifer but would you mind elaborating on what you mean, I need a link to create new news post via a button and turn off the menu.
      If you still think Audience Targeting is the right way please explain how.

Resources