You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am migrating from SharePoint 2013 to Sharepoint online and I want to transform my wiki pages to modern pages.
I use the command ConvertTo-PnPPage, all is ok.
And now I need to transform all the links "Previous_Mypage.aspx" in "MyPage.aspx" for images webparts of all moderns pages but i cannot update the link associate with the image on the webpart.
I use this code :
$clientPage =Get-PnPClientSidePage -Identity $Page["FileLeafRef"]
$AllWebParts = $clientPage.Controls
foreach ($WebPart in $AllWebParts)
{
$props = $WebPart.PropertiesJson | ConvertFrom-Json
$linkUrlNew = $props.linkUrl -replace $OldString,$NewString
$props.linkUrl = $linkUrlNew
$stringifiedProps = $props | ConvertTo-Json
Set-PnPClientSideWebPart -Page $Page["FileLeafRef"] -Identity $webpart.InstanceId -PropertiesJson $stringifiedProps
}
The properties linkUrl doesn't exist while i can see it in the PropertiesJson when the field Link of the webpart is empty :
[DBG]: PS D:\AppDSI\PPRGLB\Script_SharePointOnline\AuditBrokenLinks> $WebPart.PropertiesJson
{"imageSourceType":2,"captionText":"","altText":"","linkUrl":"","overlayText":"","fileName":"Books-on-a-shelf.jpg","imgWidth":5700,"imgHeight":3802,"alignment":"Center","resizeCoefficient":0.42542372881355933,"resizeDesiredWidth":502,"fixAspectRatio":false}
Anyone has this issue? Any suggestions? Thank you in advance for your help and sorry for my English !
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am migrating from SharePoint 2013 to Sharepoint online and I want to transform my wiki pages to modern pages.
I use the command ConvertTo-PnPPage, all is ok.
And now I need to transform all the links "Previous_Mypage.aspx" in "MyPage.aspx" for images webparts of all moderns pages but i cannot update the link associate with the image on the webpart.
I use this code :
$clientPage =Get-PnPClientSidePage -Identity $Page["FileLeafRef"]
$AllWebParts = $clientPage.Controls
foreach ($WebPart in $AllWebParts)
{
$props = $WebPart.PropertiesJson | ConvertFrom-Json
$linkUrlNew = $props.linkUrl -replace $OldString,$NewString
$props.linkUrl = $linkUrlNew
$stringifiedProps = $props | ConvertTo-Json
Set-PnPClientSideWebPart -Page $Page["FileLeafRef"] -Identity $webpart.InstanceId -PropertiesJson $stringifiedProps
}
The properties linkUrl doesn't exist while i can see it in the PropertiesJson when the field Link of the webpart is empty :
[DBG]: PS D:\AppDSI\PPRGLB\Script_SharePointOnline\AuditBrokenLinks> $WebPart.PropertiesJson
{"imageSourceType":2,"captionText":"","altText":"","linkUrl":"","overlayText":"","fileName":"Books-on-a-shelf.jpg","imgWidth":5700,"imgHeight":3802,"alignment":"Center","resizeCoefficient":0.42542372881355933,"resizeDesiredWidth":502,"fixAspectRatio":false}
Anyone has this issue? Any suggestions? Thank you in advance for your help and sorry for my English !
Beta Was this translation helpful? Give feedback.
All reactions