Forum Discussion

Sergio Ortega Martín's avatar
Sergio Ortega Martín
Copper Contributor
Oct 06, 2017

Add Custom Command Bar in Button "New" of Modern Page of Team Site

I need to add a custom action in the available actions when clicking on the "New" button of a modern page, is it possible ?

 

 

I had thought that maybe it could be done using a SharePoint Framework Extension of type "ListView Command Set" and configuring the "RegistrationType = Web" property:

  <CustomAction
         Title = "SPFxListViewCommandSet"
         RegistrationId = "100"
         RegistrationType = "List"
         Location = "ClientSideExtension.ListViewCommandSet.CommandBar"
         ClientSideComponentId = "..."
         ClientSideComponentProperties = "...">
     </ CustomAction>

Any ideas will be welcome.

Thank you!

4 Replies

  • Velin Georgiev's avatar
    Velin Georgiev
    Copper Contributor

    Modern pages are currently not supported.

    You can add commands in the list views on the following locations:

     

    Location: Where the commands are displayed. The possible values are:

    • ClientSideExtension.ListViewCommandSet.ContextMenu: The context menu of the item(s)
    • ClientSideExtension.ListViewCommandSet.CommandBar: The top command set menu in a list or library
    • ClientSideExtension.ListViewCommandSet: Both the context menu and the command bar (Corresponds to SPUserCustomAction.Location="CommandUI.Ribbon")

    https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api

     

    or use applications customizer to create similar experience. The button would not be positioned on that drop down, but instead in the `top` bar. Corresponding custom action location is `ClientSideExtension.ApplicationCustomizer`

     

     

    • MikeWalker's avatar
      MikeWalker
      Copper Contributor

      Quick question Is there a way to create a Drop down command bar on the top command set? 

       

      Thanks in advance

       

  • Anonymous's avatar
    Anonymous

    That xml was for the classic pages in the new modern sites it works different you can check it here https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api

     

  • Djavan ROA's avatar
    Djavan ROA
    Copper Contributor

    Hi,

    I'm not sure you can actualy customize the "New" menu here in a safe way, but I know you can add a new button to this toolbar with SPFx Extensions.

Resources