[英]SharePoint Office365 Powershell Webpart AllItems.aspx
Using powershell, add webpart (image) to the list view page, eg AllItems.aspx.使用powershell,在列表视图页面添加webpart(图片),eg AllItems.aspx。
This code is ok when I adding webpart to sitepage but what/how can do the same things in list当我将 webpart 添加到网站页面时,这段代码是可以的,但是什么/如何在列表中做同样的事情
$mySite = Get-PnPClientSidePage -Identity "TestWP.aspx"
$jsonProp = '{
"imageSourceType":0,
"imageSource":"https://MMMMMM.sharepoint.com/sites/pwa/SiteAssets/img01.jpg",
"captionText":" ",
"altText":" ",
"linkUrl":"",
"overlayText":"",
"fileName":"",
"siteId":"",
"webId":"",
"listId":"",
"uniqueId":"",
"imgWidth":"100%",
"imgHeight":"100%"
}'
Add-PnPClientSideWebPart -Page $mySite -Section 1 -Column 1 -Order 1 -DefaultWebPartType Image -WebPartProperties $jsonProp
coffee, a little break and I got it咖啡,稍作休息,我明白了
first manually adding a web part to the test page then download webpart in xml format首先手动添加一个 web 部分到测试页面然后下载 xml 格式的 webpart
# get xml
$imgWebPart = Get-PnPWebPartXml -ServerRelativePageUrl "/sites/pwa/Lists/TestList03/AllItems.aspx" -Identity "Image Viewer"
Add-PnPWebPartToWebPartPage -ServerRelativePageUrl "/sites/pwa/Lists/TestList03/aa.aspx" -Xml $imgWebPart -ZoneId Main -ZoneIndex 0
sorry for the confusion.对困惑感到抱歉。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.