Forum Discussion

  • Hi,

    It's directly supported in PnP via https://github.com/SharePoint/PnP-Sites-Core/issues/584

     

    In your webpart xml add one of the following params:

     

    • ViewId (guid of view)
    • ViewGuid (guid of view)
    • ViewName (display name of view)
    • ViewUrl (server relative url of view) 

    In my case I have a list view named "Recently modified documents", and added this to the webpart properties xml in my provisining template.

     

    <property name="ViewName" type="string">Recently modified documents</property>

     

    PnP then fixes the hidden view automatically for you.

    • Johannes Ekstrand's avatar
      Johannes Ekstrand
      Copper Contributor

      Awesome! That really worked, thanks for putting light on this. Wasn't able to see that when going through the PnP source code! Have now replaced my custom extention handler with this!

      • Mikael Svenson's avatar
        Mikael Svenson
        Steel Contributor

        Awesome, and feel free to change my answer to "best response" ;-)

Resources