Open Wit4r7 opened 4 years ago
I'm trying to add a ContentRollUp (or Highlighted content) ClientSideWebpart for the document libary on my sites via Add-PnPClientSideWebPart.
That a working webpart is added, as if I would create it manually. This means that the query is set to the Documents library and "any documents".
This is when I add it by hand.
A suitable Web Part is added and the query settings themselves look good, but no documents are displayed. "We didn't find anything to show here".
Get-PnPClientSideComponent -Page Home |Select *
$jsonContent = '{"displayMaps":{"1":{"headingText":{"sources":["SiteTitle"]},"headingUrl":{"sources":["SPWebUrl"]},"title":{"sources":["UserName","Title"]},"personImageUrl":{"sources":["ProfileImageSrc"]},"name":{"sources":["Name"]},"initials":{"sources":["Initials"]},"itemUrl":{"sources":["WebPath"]},"activity":{"sources":["ModifiedDate"]},"previewUrl":{"sources":["PreviewUrl","PictureThumbnailURL"]},"iconUrl":{"sources":["IconUrl"]},"accentColor":{"sources":["AccentColor"]},"cardType":{"sources":["CardType"]},"tipActionLabel":{"sources":["TipActionLabel"]},"tipActionButtonIcon":{"sources":["TipActionButtonIcon"]},"className":{"sources":["ClassName"]}},"2":{"column1":{"heading":"","sources":["FileType"],"width":34},"column2":{"heading":"Title","sources":["Title"],"linkUrls":["WebPath"],"width":250},"column3":{"heading":"Modified","sources":["ModifiedDate"],"width":100},"column4":{"heading":"Modified By","sources":["Name"],"width":150}},"3":{"id":{"sources":["UniqueID"]},"edit":{"sources":["edit"]},"DefaultEncodingURL":{"sources":["DefaultEncodingURL"]},"FileExtension":{"sources":["FileExtension"]},"FileType":{"sources":["FileType"]},"Path":{"sources":["Path"]},"PictureThumbnailURL":{"sources":["PictureThumbnailURL"]},"PreviewUrl":{"sources":["PreviewUrl"]},"SiteID":{"sources":["SiteID"]},"SiteTitle":{"sources":["SiteTitle"]},"Title":{"sources":["Title"]},"UniqueID":{"sources":["UniqueID"]},"WebId":{"sources":["WebId"]},"WebPath":{"sources":["WebPath"]}},"4":{"headingText":{"sources":["SiteTitle"]},"headingUrl":{"sources":["SPWebUrl"]},"title":{"sources":["UserName","Title"]},"personImageUrl":{"sources":["ProfileImageSrc"]},"name":{"sources":["Name"]},"initials":{"sources":["Initials"]},"itemUrl":{"sources":["WebPath"]},"activity":{"sources":["ModifiedDate"]},"previewUrl":{"sources":["PreviewUrl","PictureThumbnailURL"]},"iconUrl":{"sources":["IconUrl"]},"accentColor":{"sources":["AccentColor"]},"cardType":{"sources":["CardType"]},"tipActionLabel":{"sources":["TipActionLabel"]},"tipActionButtonIcon":{"sources":["TipActionButtonIcon"]},"className":{"sources":["ClassName"]}}},"query":{"contentLocation":4,"contentTypes":[1],"sortType":1,"filters":[{"filterType":1,"value":"","values":[]}],"documentTypes":[99],"advancedQueryText":""},"templateId":1,"maxItemsPerPage":5,"hideWebPartWhenEmpty":false,"sites":[],"queryMode":"Basic","layoutId":"Card","dataProviderId":"List","webId":"b236a647-e41a-4aa3-af93-7f595f641298","siteId":"57b1316e-057d-4eb3-869b-3a66111d3718","lastListId":"2cea5f77-590c-45c7-a845-b87f8c868afe","listId":"2cea5f77-590c-45c7-a845-b87f8c868afe","listTitle":"Documents","caml":"<View Scope=\"RecursiveAll\"><Query><Where><Eq><FieldRef Name=\"FSObjType\" /><Value Type=\"Integer\">0</Value></Eq></Where><OrderBy><FieldRefName=\"Modified\" Ascending=\"false\" /></OrderBy></Query><ViewFields><FieldRef Name=\"Editor\" /><FieldRef Name=\"FileLeafRef\" /><FieldRef Name=\"File_x0020_Type\" /><FieldRefName=\"ID\" /><FieldRef Name=\"Modified\" /><FieldRef Name=\"Title\" /><FieldRef Name=\"UniqueID\" /><FieldRef Name=\"_ShortcutUrl\" /></ViewFields><RowLimitPaged=\"false\">5</RowLimit></View>"}'
Add-PnPClientSideWebPart -Page $page -DefaultWebPartType "ContentRollup" -Section 1 -Column 1 -WebPartProperties @{layoutId=”Card”;title=”Recent documents”}
Set-PnPClientSideWebPart -Page $page -Identity $temp.InstanceId -PropertiesJson $jsonContent
The result is visible in the screenshot above.
3.22.2006.2
Reporting an Issue or Missing Feature
I'm trying to add a ContentRollUp (or Highlighted content) ClientSideWebpart for the document libary on my sites via Add-PnPClientSideWebPart.
Expected behavior
That a working webpart is added, as if I would create it manually. This means that the query is set to the Documents library and "any documents".
This is when I add it by hand.
Actual behavior
A suitable Web Part is added and the query settings themselves look good, but no documents are displayed. "We didn't find anything to show here".
Steps to reproduce behavior
Get-PnPClientSideComponent -Page Home |Select *
after connecting to the site$jsonContent = '{"displayMaps":{"1":{"headingText":{"sources":["SiteTitle"]},"headingUrl":{"sources":["SPWebUrl"]},"title":{"sources":["UserName","Title"]},"personImageUrl":{"sources":["ProfileImageSrc"]},"name":{"sources":["Name"]},"initials":{"sources":["Initials"]},"itemUrl":{"sources":["WebPath"]},"activity":{"sources":["ModifiedDate"]},"previewUrl":{"sources":["PreviewUrl","PictureThumbnailURL"]},"iconUrl":{"sources":["IconUrl"]},"accentColor":{"sources":["AccentColor"]},"cardType":{"sources":["CardType"]},"tipActionLabel":{"sources":["TipActionLabel"]},"tipActionButtonIcon":{"sources":["TipActionButtonIcon"]},"className":{"sources":["ClassName"]}},"2":{"column1":{"heading":"","sources":["FileType"],"width":34},"column2":{"heading":"Title","sources":["Title"],"linkUrls":["WebPath"],"width":250},"column3":{"heading":"Modified","sources":["ModifiedDate"],"width":100},"column4":{"heading":"Modified By","sources":["Name"],"width":150}},"3":{"id":{"sources":["UniqueID"]},"edit":{"sources":["edit"]},"DefaultEncodingURL":{"sources":["DefaultEncodingURL"]},"FileExtension":{"sources":["FileExtension"]},"FileType":{"sources":["FileType"]},"Path":{"sources":["Path"]},"PictureThumbnailURL":{"sources":["PictureThumbnailURL"]},"PreviewUrl":{"sources":["PreviewUrl"]},"SiteID":{"sources":["SiteID"]},"SiteTitle":{"sources":["SiteTitle"]},"Title":{"sources":["Title"]},"UniqueID":{"sources":["UniqueID"]},"WebId":{"sources":["WebId"]},"WebPath":{"sources":["WebPath"]}},"4":{"headingText":{"sources":["SiteTitle"]},"headingUrl":{"sources":["SPWebUrl"]},"title":{"sources":["UserName","Title"]},"personImageUrl":{"sources":["ProfileImageSrc"]},"name":{"sources":["Name"]},"initials":{"sources":["Initials"]},"itemUrl":{"sources":["WebPath"]},"activity":{"sources":["ModifiedDate"]},"previewUrl":{"sources":["PreviewUrl","PictureThumbnailURL"]},"iconUrl":{"sources":["IconUrl"]},"accentColor":{"sources":["AccentColor"]},"cardType":{"sources":["CardType"]},"tipActionLabel":{"sources":["TipActionLabel"]},"tipActionButtonIcon":{"sources":["TipActionButtonIcon"]},"className":{"sources":["ClassName"]}}},"query":{"contentLocation":4,"contentTypes":[1],"sortType":1,"filters":[{"filterType":1,"value":"","values":[]}],"documentTypes":[99],"advancedQueryText":""},"templateId":1,"maxItemsPerPage":5,"hideWebPartWhenEmpty":false,"sites":[],"queryMode":"Basic","layoutId":"Card","dataProviderId":"List","webId":"b236a647-e41a-4aa3-af93-7f595f641298","siteId":"57b1316e-057d-4eb3-869b-3a66111d3718","lastListId":"2cea5f77-590c-45c7-a845-b87f8c868afe","listId":"2cea5f77-590c-45c7-a845-b87f8c868afe","listTitle":"Documents","caml":"<View Scope=\"RecursiveAll\"><Query><Where><Eq><FieldRef Name=\"FSObjType\" /><Value Type=\"Integer\">0</Value></Eq></Where><OrderBy><FieldRefName=\"Modified\" Ascending=\"false\" /></OrderBy></Query><ViewFields><FieldRef Name=\"Editor\" /><FieldRef Name=\"FileLeafRef\" /><FieldRef Name=\"File_x0020_Type\" /><FieldRefName=\"ID\" /><FieldRef Name=\"Modified\" /><FieldRef Name=\"Title\" /><FieldRef Name=\"UniqueID\" /><FieldRef Name=\"_ShortcutUrl\" /></ViewFields><RowLimitPaged=\"false\">5</RowLimit></View>"}'
Add-PnPClientSideWebPart -Page $page -DefaultWebPartType "ContentRollup" -Section 1 -Column 1 -WebPartProperties @{layoutId=”Card”;title=”Recent documents”}
Set-PnPClientSideWebPart -Page $page -Identity $temp.InstanceId -PropertiesJson $jsonContent
The result is visible in the screenshot above.
Which version of the PnP-PowerShell Cmdlets are you using?
What is the version of the Cmdlet module you are running?
3.22.2006.2
How did you install the PnP-PowerShell Cmdlets?