modern pages
42 TopicsAnnouncing SharePoint page approvals
We are happy to announce that we will be releasing SharePoint page approvals to Targeted Release. We expect to start the rollout of this feature to all Targeted Release tenants by end of July 2018. Rollout status Current rollout status: July 31st, 2018 - Deployed to 10% of Targeted Release tenants August 3rd, 2018 - Deployed to 50% of Targeted Release tenants August 6th, 2018 - Deployed to 100% of Targeted Release tenants January 8th, 2019 - Deployed to all tenants in SharePoint Online Documentation: 1. https://support.office.com/en-us/article/configure-page-approval-14ce6976-a0a7-427b-b4ab-d28d344a5222 2. https://support.office.com/en-us/article/page-approval-flow-a8b2e689-d4a1-4639-8028-333c0ece30d9 Known issues If the page is checked-out by another user and you (the author in this case) submit the page for approval, the page will not notify and proceed with the approval. The flow will run and send an email indicating to the author indicating an error occurred in publishing the page. If you have only major versions enabled for the Site Pages library, submit for approval will result in int he following error: Could not complete that action: The type of data at position 0 is different than the one expected. There an issue with the Flow service for the UK region. Any existing UK tenants created before March 2018 will work while it affects only new tenants created after March 2018. We expect to have this resolved by end of September if everything goes according to the plan. See this thread for more information. Good news is that these will be fixed soon are fixed! If you have any feedback, please make sure you discuss here! Configure page approval Site owners can configure page approval to add to the standard publishing process for a site. After adding page approval flow, new and updated pages will be not be published directly. Instead, only the completion of the approval flow will make changes visible to all readers of the site. A site owner can configure page approval flow from the Flow menu of a pages library. Submit page for approval Once the page approval is configured, authors will be able to submit page for approval. The publish button will be replaced by a submit for approval button. The page will be published once the page is approved. Rejecting a page will put that page back to draft status. Approve page Approvers will get an email regarding the page approval request. They can either approve the page directly in the email (in email clients that support actionable messages) or open the page from the email to review and approve the page in SharePoint. Customizing the page approval flow Since page approvals use Microsoft Flow behind the scenes, the page approval flow is available to site owners to modify and add any custom business process items in the flow. After creating the flow, the site owner can click on Flows -> See your flows in the pages library to find the page approval flow. For example, The default approval type is set to ‘anyone can approve’. Site owners can modify the flow and change the approval type to ‘everyone must approve’ if that is the requirement.48KViews16likes63CommentsHow to join the 2 SharePoint News World - Old Publishing site and Modern Teamsite
The SharePoint solution is changing since some years and Microsoft is moving fast to implement the Modern capabilities in all the SharePoint components. In the past, the Intranet site was built for most of the case, using the Publishing sites (technology existing since many years, probably SP 2003 for a large part), but today, the best solution could be to focus on the Communication sites associated with the modern sites. The problem is now with the existing Corporate sites running a huge solution based on the SharePoint Publishing: How to show my Publishing News into the Basic Office 365 SharePoint app (mobile or Web) ? A solution could be the usage of the "Repost Page". What is the Repost Page: That "Repost Page" is a dedicated Page layout used into the Modern Page, showing the user the news published in another Teamsite (cf. Communication Hub Site to understand the logic). The Hub Site is creating this without any user action, but anyone with the contribution access into a modern teamsite can create a "Repost Page" (named "News Link") to republish into his teamsite something published initially somewhere else (like the Retweet). It could be a link into the SharePoint, but also pointing anything else (Bing News for example). When you are clicking that link, the system will ask you to put first the destination Link and after complete the Image, the title and the description When that creation is done, the "Repost Page" will be visible into the Modern News webpart like any other News page but also into the Global Tenant Root page: https://[YourTenant].sharepoint.com/_layouts/15/sharepoint.aspx> So you can dedicate someone to republish the Publishing News into a Modern Page Library using the Repost Page layout, but that will not be so nice for him, and the PowerShell script cold be a good idea to do that. PowerShell script to create the Repost Page: Based on the previous message published: How to create Repost Page (Modern Page Library) with PowerShell I created this script fully adapted to my case and has 3 functions: Get the last published news on the old portal based on the search engine and export it to CSV Load the CSV file to check if the repost page is yet existing (if not yet, create it) Change the metadata of the Modern Reports News to set the correct creator and author [string]$SitePagesURL ="https://YourTenant.sharepoint.com" [string]$PageLibPublicName = "Site Pages" [DateTime]$MyCSVPublishingDate = Get-Date [DateTime]$PortalPublishingDate = Get-Date [string]$MyCSVPublisher = "" [string]$MyCSVTitle = "" [string]$MyCSVNewsURL = "" [string]$MyCSVNewsPictureURL = "" [string]$MyCSVNewsDescription = "" [string]$CSVFileName = "ExportGlobalNewsItems.csv" [string]$NewsPageFileName = "" [string]$queryText = "ContentTypeId:0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00DAB155038B062847A409F1E450E9E5E3* Path:https://yourTenant.sharepoint.com/yourintranet " [string]$srcrpattern = '(?i)src="(.*?)"' [string]$outputline = "" [int]$TempUserID = 0 # --------------------------------------------------------------------------------------------------------------- function Load-DLLandAssemblies { [string]$defaultDLLPath = "" # Load assemblies to PowerShell session $defaultDLLPath = "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll" [System.Reflection.Assembly]::LoadFile($defaultDLLPath) $defaultDLLPath = "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.Runtime.dll" [System.Reflection.Assembly]::LoadFile($defaultDLLPath) $defaultDLLPath = "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll" [System.Reflection.Assembly]::LoadFile($defaultDLLPath) $defaultDLLPath = "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Client.Search\v4.0_16.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Client.Search.dll" #$defaultDLLPath = "D:\TOOLS\SHAREPOINT\SP_ONLINE\sharepointclientcomponents\microsoft.sharepointonline.csom.16.1.8119.1200\lib\net40-full\Microsoft.SharePoint.Client.Search.dll" [System.Reflection.Assembly]::LoadFile($defaultDLLPath) } # --------------------------------------------------------------------------------------------------------------- Function Get-All-Intranet-News-Published-ExportCSV($MyctxTemp, $MyspoRootwebTemp) { # add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM $keywordQuery = New-Object Microsoft.SharePoint.Client.Search.Query.KeywordQuery($MyctxTemp) $keywordQuery.QueryText = $queryText $keywordQuery.RowLimit = 50 $keywordQuery.TrimDuplicates=$false $keywordQuery.SelectProperties.Add("LastModifiedTime") $keywordQuery.SelectProperties.Add("Modified") $keywordQuery.SelectProperties.Add("ModifiedBy") $keywordQuery.SelectProperties.Add("IntranetPublisher") $keywordQuery.SelectProperties.Add("DescriptionResumeOWSTEXT") $keywordQuery.SelectProperties.Add("PublishingImage") $keywordQuery.SortList.Add("Modified","Desc") $searchExecutor = New-Object Microsoft.SharePoint.Client.Search.Query.SearchExecutor($MyctxTemp) $results = $searchExecutor.ExecuteQuery($keywordQuery) $MyctxTemp.ExecuteQuery() Write-Host $results.Value[0].ResultRows.Count Clear-Content $CSVFileName $outputline = '"NewsTitle";"PublisherEmail";"PublicationDate";"NewsURL";"NewsPictureURL";"NewsDescription";' Add-Content -Encoding UTF8 -Force $CSVFileName $outputline foreach($result in $results.Value[0].ResultRows) { $TempString = $result["Modified"].split(';')[0] $ImageURLsrc=([regex]$srcrpattern ).Matches($result["PublishingImage"]) | ForEach-Object { $_.Groups[1].Value } $ImageURLsrc=$SitePagesURL + $ImageURLsrc.split('?')[0] +"?RenditionID=9" $PortalPublishingDate=[datetime]::ParseExact([string]$TempString, 'M/d/yyyy h:mm:ss tt', [CultureInfo]::InvariantCulture) $PublisherDetails = $result["IntranetPublisher"].split('|') #Write-Host " ------>>> TempString:", $TempString #Write-Host " ------>>> PublisherDetails:", $PublisherDetails.Count, "- LastField:", $PublisherDetails[4].Trim() #Write-Host " ------>>> PublishingImage:", $result["PublishingImage"] #Write-Host " ------>>> Modified:", $result["Modified"] Write-Host " ---------------------------------------- " Write-Host " ------>>> NewsPath:", $result["Path"] Write-Host " ------>>> Title:", $result["Title"] Write-Host " ------>>> PublicationDate:", $PortalPublishingDate Write-Host " ------>>> IntranetPublisherEmail:", $PublisherDetails[4].Trim() Write-Host " ------>>> ImageURLsrc:", $ImageURLsrc Write-Host " ------>>> DescriptionResumeOWSTEXT:", $result["DescriptionResumeOWSTEXT"] Write-Host " ---------------------------------------- " #CSV file location, to store the result $outputline = '"'+ $result["Title"] +'";"'+ $PublisherDetails[4].Trim() +'";"'+ $PortalPublishingDate.ToString("dd.MM.yyyy hh:mm:ss") +'";"'+ $result["Path"] +'";"'+ $ImageURLsrc +'";"'+ $result["DescriptionResumeOWSTEXT"] +'";' Add-Content -Encoding UTF8 -Force $CSVFileName $outputline } } # --------------------------------------------------------------------------------------------------------------- Function Get-All-News-PageList-ComparedToCSV($MyctxTemp, $MyspoRootwebTemp) { $GlobalNewsPageCSV = Import-Csv -encoding UTF8 $CSVFileName -delimiter ";" $GlobalNewsPageCSV | Format-Table $Alllists = $MyspoRootwebTemp.Lists $MyPagelist = $Alllists.GetByTitle($PageLibPublicName) $MyPagelistItems = $MyPagelist.GetItems([Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery(9999)) $MyctxTemp.load($MyPagelistItems) $MyctxTemp.executeQuery() foreach($PageItem in $MyPagelistItems) { Write-Host "" Write-Host "" Write-Host " --------------------------------------------------------- " <# foreach($MyFieldval in $PageItem.FieldValues) { Write-Host " >>> FieldName:", $MyFieldval } #> $ModifiedByuser = $PageItem["Editor"] $CreatedByuser = $PageItem["Author"] Write-Host "ID:", $PageItem["ID"], "- Title:", $PageItem["Title"], "- Original Publication Date:", $PageItem["Modified"] Write-Host " ==>>> PromotedState:", $PageItem["PromotedState"], "- PageLayoutType:", $PageItem["PageLayoutType"] -ForegroundColor red Write-Host " ===> Modified by:", $ModifiedByuser.LookupValue, "[", $ModifiedByuser.LookupId, "] - Created by:", $CreatedByuser.LookupValue, "[", $CreatedByuser.LookupId, "]" Write-Host " >> _OriginalSourceUrl:", $PageItem["_OriginalSourceUrl"] -ForegroundColor magenta Write-Host " >> Description:", $PageItem["Description"] Write-Host " >> BannerImageUrl:", $PageItem["BannerImageUrl"].URL, "- URLDesc:", $PageItem["BannerImageUrl"].Description #[BannerImageUrl, Microsoft.SharePoint.Client.FieldUrlValue] Write-Host " >> ContentTypeId:", $PageItem["ContentTypeId"] # [ContentTypeId, 0x0101009D1CB255DA76424F860D91F20E6C4118002A50BFCFB7614729B56886FADA02339B00FB61AB42CC88E741A501DF164E1EDB74] $searchTerm = $PageItem["_OriginalSourceUrl"] $MyCSVPublishingDate = Get-Date $GlobalNewsPageCSV |Where-Object {$_.NewsURL -match $searchTerm} |foreach-object{ $MyCSVTitle=$_.NewsTitle; $MyCSVNewsURL=$_.NewsURL; $MyCSVPublisher=$_.PublisherEmail; $MyCSVPublishingDate=[datetime]::ParseExact($_.PublicationDate,'dd.MM.yyyy hh:mm:ss',$null) } if ($PageItem["_OriginalSourceUrl"] -eq $MyCSVNewsURL) { Write-Host " >>> CSV Title found:", $MyCSVTitle, "- CSV Publication Date:", $MyCSVPublishingDate, "- Publisher:", $MyCSVPublisher -ForegroundColor Yellow Write-Host " >> CSV NewsURL:", $MyCSVNewsURL -ForegroundColor magenta #Load Context for the target link page $PageItem["_OriginalSourceUrl"] $TempUri = new-object Uri($MyCSVNewsURL) [string]$TempserverRelativeURL = $TempUri.AbsolutePath [string]$MyTempSubWebURL = $MyCSVNewsURL.substring(0, $MyCSVNewsURL.IndexOf('Pages')) Write-Host " === >> MyTempSubWebURL:", $MyTempSubWebURL -ForegroundColor Yellow Write-Host " === >> TempserverRelativeURL:", $TempserverRelativeURL -ForegroundColor Yellow $MyDestinationPagectx = New-Object Microsoft.SharePoint.Client.ClientContext($MyTempSubWebURL) $MyDestinationPagectx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($cred.UserName,$cred.Password) $MyDestinationPagectx.RequestTimeout = 1000000 # milliseconds $MyDestinationPageweb = $MyDestinationPagectx.Web $MyDestinationPageSiteColl = $MyDestinationPagectx.Site $MyDestinationPagelist = $MyDestinationPageweb.Lists.GetByTitle("Pages") $MyDestinationPageFile = $MyDestinationPageweb.GetFileByServerRelativeUrl($TempserverRelativeURL); $MyDestinationPageFileitem = $MyDestinationPageFile.ListItemAllFields; $MyDestinationPagectx.Load($MyDestinationPageweb) $MyDestinationPagectx.Load($MyDestinationPageSiteColl) $MyDestinationPagectx.Load($MyDestinationPagelist) $MyDestinationPagectx.Load($MyDestinationPageFileitem) $MyDestinationPagectx.ExecuteQuery() Write-Host " === >> DestinationPage Site URL:", $MyDestinationPageSiteColl.Url, "- ID:", $MyDestinationPageSiteColl.ID -ForegroundColor white Write-Host " === >> DestinationPage Web URL:", $MyDestinationPageweb.Url, "- ID:", $MyDestinationPageweb.ID -ForegroundColor white Write-Host " === >> DestinationPage PageList Title:", $MyDestinationPagelist.Title, "- ID:", $MyDestinationPagelist.ID -ForegroundColor white Write-Host " === >> DestinationPage PageFile Title:", $MyDestinationPageFileitem["Title"].ToString(), "- ID:", $MyDestinationPageFileitem["UniqueId"].ToString() $MyEditoruserAccount = $MyspoRootwebTemp.EnsureUser("i:0#.f|membership|$($MyCSVPublisher)"); $MyctxTemp.load($MyEditoruserAccount) $MyctxTemp.executeQuery() Write-Host " ===> Modified Account Login:", $MyEditoruserAccount.LoginName -ForegroundColor Magenta $PageItem["Created_x0020_By"] = $MyEditoruserAccount.LoginName $PageItem["Modified_x0020_By"] = $MyEditoruserAccount.LoginName $PageItem["PromotedState"] = "2" $PageItem["PageLayoutType"] = "RepostPage" $PageItem["ClientSideApplicationId"] = "b6917cb1-93a0-4b97-a84d-7cf49975d4ec" $PageItem["_OriginalSourceSiteId"] = $MyDestinationPageSiteColl.ID $PageItem["_OriginalSourceWebId"] = $MyDestinationPageweb.ID $PageItem["_OriginalSourceListId"] = $MyDestinationPagelist.ID $PageItem["_OriginalSourceItemId"] = $MyDestinationPageFileitem["UniqueId"].ToString() $PageItem["Modified"] = $MyCSVPublishingDate; $PageItem["Created"] = $MyCSVPublishingDate; $PageItem["FirstPublishedDate"] = $MyCSVPublishingDate; $PageItem["Editor"] = $MyEditoruserAccount.Id; $PageItem["Author"] = $MyEditoruserAccount.Id $PageItem.Update() $MyctxTemp.ExecuteQuery() } else { Write-Host " >>> CSV Title not found:", $MyCSVTitle, "- Date:", $MyCSVPublishingDate, "- Publisher:", $MyCSVPublisher -ForegroundColor Red Write-Host " >> CSV NewsURL:", $MyCSVNewsURL -ForegroundColor Red } Write-Host " --------------------------------------------------------- " } } Function Get-All-CSVNews-ComparedToPageList($MyctxTemp, $MyspoRootwebTemp) { $GlobalNewsPageCSV = Import-Csv -encoding UTF8 $CSVFileName -delimiter ";" $GlobalNewsPageCSV | Format-Table foreach($CSVItem in $GlobalNewsPageCSV) { Write-Host " --------------------------------------------------------- " Write-Host " >> CSV NewsTitle:", $CSVItem.NewsTitle Write-Host " >> CSV NewsURL:", $CSVItem.NewsURL Write-Host " >> CSV PublisherEmail:", $CSVItem.PublisherEmail Write-Host " >> CSV PublicationDate:", $CSVItem.PublicationDate Write-Host " >> CSV NewsPictureURL:", $CSVItem.NewsPictureURL Write-Host " >> CSV NewsDescription:", $CSVItem.NewsDescription $MyCSVTitle = $CSVItem.NewsTitle $MyCSVNewsURL = $CSVItem.NewsURL $MyCSVPublisher = $CSVItem.PublisherEmail $MyCSVPublishingDate = [datetime]::ParseExact($CSVItem.PublicationDate,'dd.MM.yyyy hh:mm:ss',$null) $MyCSVNewsPictureURL = $CSVItem.NewsPictureURL $MyCSVNewsDescription = $CSVItem.NewsDescription #Load Context for the target link page $PageItem["_OriginalSourceUrl"] $TempUri = new-object Uri($MyCSVNewsURL) [string]$TempserverRelativeURL = $TempUri.AbsolutePath [string]$MyTempSubWebURL = $MyCSVNewsURL.substring(0, $MyCSVNewsURL.IndexOf('Pages')) Write-Host " === >> MyTempSubWebURL:", $MyTempSubWebURL -ForegroundColor Yellow Write-Host " === >> TempserverRelativeURL:", $TempserverRelativeURL -ForegroundColor Yellow $MyDestinationPagectx = New-Object Microsoft.SharePoint.Client.ClientContext($MyTempSubWebURL) $MyDestinationPagectx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($cred.UserName,$cred.Password) $MyDestinationPagectx.RequestTimeout = 1000000 # milliseconds $MyDestinationPageweb = $MyDestinationPagectx.Web $MyDestinationPageSiteColl = $MyDestinationPagectx.Site $MyDestinationPagelist = $MyDestinationPageweb.Lists.GetByTitle("Pages") $MyDestinationPageFile = $MyDestinationPageweb.GetFileByServerRelativeUrl($TempserverRelativeURL); $MyDestinationPageFileitem = $MyDestinationPageFile.ListItemAllFields; $MyDestinationPagectx.Load($MyDestinationPageweb) $MyDestinationPagectx.Load($MyDestinationPageSiteColl) $MyDestinationPagectx.Load($MyDestinationPagelist) $MyDestinationPagectx.Load($MyDestinationPageFileitem) $MyDestinationPagectx.ExecuteQuery() Write-Host " === >> DestinationPage Site URL:", $MyDestinationPageSiteColl.Url, "- ID:", $MyDestinationPageSiteColl.ID -ForegroundColor white Write-Host " === >> DestinationPage Web URL:", $MyDestinationPageweb.Url, "- ID:", $MyDestinationPageweb.ID -ForegroundColor white Write-Host " === >> DestinationPage PageList Title:", $MyDestinationPagelist.Title, "- ID:", $MyDestinationPagelist.ID -ForegroundColor white Write-Host " === >> DestinationPage PageFile Title:", $MyDestinationPageFileitem["Title"].ToString(), "- ID:", $MyDestinationPageFileitem["UniqueId"].ToString() $MyEditoruserAccount = $MyspoRootwebTemp.EnsureUser("i:0#.f|membership|$($MyCSVPublisher)"); $MyctxTemp.load($MyEditoruserAccount) $MyctxTemp.executeQuery() $MyPagelist = $MyspoRootwebTemp.Lists.GetByTitle($PageLibPublicName) $MyQuery = New-Object Microsoft.SharePoint.Client.CamlQuery; $MyQuery.ViewXml = "<View><Query><Where><Eq><FieldRef Name='_OriginalSourceUrl' /><Value Type='Text'>$MyCSVNewsURL</Value></Eq></Where></Query></View>" $MyPagelistItems = $MyPagelist.GetItems($MyQuery); $MyctxTemp.Load($MyPagelistItems) $MyctxTemp.ExecuteQuery() if($MyPagelistItems.Count -lt 1) { [string]$NewsPageFileName = "/yourintranet/SitePages/"+ $MyCSVPublishingDate.ToString("yyyyMMdd") +'-'+ $CSVItem.NewsURL.Substring($CSVItem.NewsURL.LastIndexOf("/") + 1) Write-Host " >> $($MyPagelistItems.Count) PageList Item Found, Need to be created [ $NewsPageFileName ]" -ForegroundColor Red # TO CREATE !!! $NewPageitem = $MyPagelist.RootFolder.Files.AddTemplateFile($NewsPageFileName, [Microsoft.SharePoint.Client.TemplateFileType]::ClientSidePage).ListItemAllFields # Make this page a "modern" page $NewPageitem["ContentTypeId"] = "0x0101009D1CB255DA76424F860D91F20E6C4118002A50BFCFB7614729B56886FADA02339B00874A802FBA36B64BAB7A47514EAAB232"; $NewPageitem["PageLayoutType"] = "RepostPage" $NewPageitem["PromotedState"] = "2" $NewPageitem["Title"] = $CSVItem.NewsTitle $NewPageitem["ClientSideApplicationId"] = "b6917cb1-93a0-4b97-a84d-7cf49975d4ec" $NewPageitem["_OriginalSourceSiteId"] = $MyDestinationPageSiteColl.ID $NewPageitem["_OriginalSourceWebId"] = $MyDestinationPageweb.ID $NewPageitem["_OriginalSourceListId"] = $MyDestinationPagelist.ID $NewPageitem["_OriginalSourceItemId"] = $MyDestinationPageFileitem["UniqueId"].ToString() $NewPageitem["_OriginalSourceUrl"] = $MyCSVNewsURL $NewPageitem["Editor"] = $MyEditoruserAccount.Id $NewPageitem["Author"] = $MyEditoruserAccount.Id $NewPageitem["Description"] = $MyCSVNewsDescription $NewPageitem["BannerImageUrl"] = $MyCSVNewsPictureURL; $NewPageitem["Modified"] = $MyCSVPublishingDate; $NewPageitem["Created"] = $MyCSVPublishingDate; $NewPageitem["Created_x0020_By"] = $MyEditoruserAccount.LoginName $NewPageitem["Modified_x0020_By"] = $MyEditoruserAccount.LoginName $NewPageitem["FirstPublishedDate"] = $MyCSVPublishingDate; $NewPageitem.Update(); $MyctxTemp.Load($NewPageitem); $MyctxTemp.ExecuteQuery(); } elseif($MyPagelistItems.Count -eq 1) { Write-Host " >> $($MyPagelistItems.Count) Page Item Found, Case OK !!!" -ForegroundColor Yellow # TO CHECK AND UPDATE VIA SCRIPT !!! #Loop through each item (only one if that is OK) $MyPagelistItems | ForEach-Object { #Get the Title field value Write-Host " >> PageList NewsTitle:", $_["Title"] -ForegroundColor Yellow Write-Host " >> PageList NewsUrl:", $_["_OriginalSourceUrl"] -ForegroundColor Yellow if($MyCSVNewsPictureURL -ne $_["BannerImageUrl"].URL) { $_["BannerImageUrl"].URL = $MyCSVNewsPictureURL $_["BannerImageUrl"].Description = $MyCSVNewsPictureURL } $_["PromotedState"] = "2" $_["Modified"] = $MyCSVPublishingDate; $_["Created"] = $MyCSVPublishingDate; $_["FirstPublishedDate"] = $MyCSVPublishingDate; $_["_OriginalSourceSiteId"] = $MyDestinationPageSiteColl.ID $_["_OriginalSourceWebId"] = $MyDestinationPageweb.ID $_["_OriginalSourceListId"] = $MyDestinationPagelist.ID $_["_OriginalSourceItemId"] = $MyDestinationPageFileitem["UniqueId"].ToString() $_["Editor"] = $MyEditoruserAccount.Id; $_["Author"] = $MyEditoruserAccount.Id $_["Created_x0020_By"] = $MyEditoruserAccount.LoginName $_["Modified_x0020_By"] = $MyEditoruserAccount.LoginName $_.Update() $MyctxTemp.ExecuteQuery() } } else { Write-Host " >> $($MyPagelistItems.Count) PageList Item Found, Need to be fixed !!!" -ForegroundColor Red # TO CHECK AND CONTROL MANUALLY !!! $MyPagelistItems | ForEach-Object { #Get the Title field value Write-Host " >> PageList NewsTitle:", $_["Title"] -ForegroundColor Yellow Write-Host " >> PageList NewsUrl:", $_["_OriginalSourceUrl"] -ForegroundColor Yellow } } } } # --------------------------------------------------------------------------------------------------------------- Load-DLLandAssemblies #get and save your O365 credentials [string]$username = "AdminAccount@Yourtenant.onmicrosoft.com" [string]$PwdTXTPath = "C:\SECUREDPWD\ExportedPWD-$($username).txt" $secureStringPwd = ConvertTo-SecureString -string (Get-Content $PwdTXTPath) $cred = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $secureStringPwd #connect to the web site using the stored credentials Write-host " " Write-host " -------------------------------------------------------------------------------------------- " -ForegroundColor green Write-host " ---- CONNECT THE SITE --- " -ForegroundColor green Write-host " CONNECTED SITE:", $SitePagesURL -ForegroundColor Yellow $Myctx = New-Object Microsoft.SharePoint.Client.ClientContext($SitePagesURL +"/yourintranet") $Myctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($cred.UserName,$cred.Password) $Myctx.RequestTimeout = 1000000 # milliseconds $MyspoRootweb = $Myctx.Web $Myctx.Load($MyspoRootweb) $Myctx.ExecuteQuery() Write-Host " " Write-Host " ---------------------------------------------------------" Write-Host " >>>> # Server Version:" $Myctx.ServerVersion " # <<<<<<" -ForegroundColor Green Write-Host " ---------------------------------------------------------" Write-Host " " Write-host " -------------------------------------------------------- " Write-host " -->> RootSite:", $MyspoRootweb.URL -ForegroundColor green Write-host " " Get-All-Intranet-News-Published-ExportCSV $Myctx $MyspoRootweb Get-All-CSVNews-ComparedToPageList $Myctx $MyspoRootweb Get-All-News-PageList-ComparedToCSV $Myctx $MyspoRootweb You can easily modify it with your own requirements, but I use it now to enrich the last 500 published news into the modern library, and that was working perfectly. Fabrice Romelard French version: SharePoint: Comment Utiliser les Modern Pages dans un Site Intranet basé sur le Publishing site4KViews4likes0CommentsSearch box changes in modern SharePoint and OneDrive experiences
We wanted to make sure that the community is aware of some UX changes coming to the search box on modern OneDrive and SharePoint experiences! These are part of the changes we had announced as part of Message Center post published on March 28 (MC176702), and then talked about in our blog posts at Build and SharePoint conferences this month. The changes we are detailing below are already rolled out to Targeted Release users and tenants. So if you are part of the Targeted Release program, you should already be using these updated experiences. The major experience change is the removal of the search box in modern experiences from where it was in the site header in communication sites, or the command bar in team sites. A new search box connecting our users to Microsoft Search will be shown at the top of the page in the suite header instead, and provide a consistent place to access search functionality. Similar changes are rolling out to other experiences across Office 365: Office.com, Office desktop applications, Outlook on the web, etc. SharePoint start page shown after the search box move The change will affect the following modern experiences: SharePoint start page (formerly known as SharePoint home). This is the page you are taken to when you click on "SharePoint" in the suite navigation control. Modern SharePoint sites, including modern site pages, document libraries, lists, and the site contents page. OneDrive for Business. Classic sites/experiences will not be affected by this update. The search boxes on classic pages will continue to work as they currently do. We will provide an update to classic experiences later this year. This change will be announced using message center posts as well as this community. Hub site with the Microsoft Search search box - scoped to search across the hub This update will take effect without requiring any action from you. The functionality provided by the new search box includes personalized suggestions in addition to functionality provided by the previous search box. We are planning to roll out these updates to our customers in Production over the coming weeks during the month of June. Note: During our rollout to Targeted Release, we have heard from a small number of customers who had customized the search box experiences and had adverse effects. If you have customized your search box, please ensure that you test the changes using Targeted Release users in your tenant to make sure that you are not negatively affected. If you see negative effects, follow this link and tell us more about it.35KViews3likes33CommentsBug/issue with modern news thumbnail if team site has header image
I'm experiencing a rather strange issue with modern team news. I have this issue on two different O365 tenants. When a team site has a header image - the news thumbnail will render the site header image, not an image from the news post. This is the news web part - the news item thumbnail is the same image as the site header: Even though the news item looks like this:16KViews2likes17CommentsSharePoint - How to create a set of Modern Pages from CSV list using PowerShell
In some case, it could be useful to use the Modern Pages into the Help site pages. The previous generic case proposed was the Wiki Site with Wiki Pages. Advantage to use the Modern Pages In SharePoint Online the implementation of the modern pages propose many features useful and simplifying the end user navigation: Modern Page display Modern WebPart component Integration of the Modern Pages into the Modern News WebPart Aggregation of the Modern Pages into the Communication Hub Site Aggregation of the Modern Pages into the SharePoint Application (Web and Mobile) Adaptation of the display for any Devices without any development ... It's really a basic to match with the Microsoft Strategy and the Wiki Site/Page is not anymore part of it. Business Case presentation This solution is matching with a dedicated requirement I had: Associated with a Business CheckList, create one Help Page per check task automatically Group the Help page into the Site left menu navigation per topic Implement into each page then basic template using one canvas and text basic Automatize the page creation and menu item creation The CSV file need to have only the following entries (columns): CHECKID: with a Text format like "1.01", used for the filename "1.01.aspx" CHECKNAME: with Text format with the long task name like "Collect data from the business line" CHECKTOPIC: with Text format like "01. BASICS TASKS" A generic picture per topic need to be placed into the current SiteAsset library with the name "$(CHECKTOPIC).JPG". When the Script is executed the responsible of the Checklist have to edit each page to complete the content into the different parts like: ------------------------------- Task Title: Collect the Data from the Business Topic: 01. BASIC TASKS Description: Get all the data from the business line to be sure the mission is ready to start Estimated Time: Some minutes Person in charge: Task Manager Starting time: When the mission is started ------------------------------------- PowerShell script: You can use that script and adapt it to your specific case as you want, it's only a base to use. $HelpAndQAUrl = "https://[YourTenant].sharepoint.com/sites/SiteCollection/helpsite" $CSVFilePath = "C:\Business-CheckList.csv" ##Connecting to site - get and save your O365 credentials [string]$username = "Admin@YourTenant.onmicrosoft.com" [string]$PwdTXTPath = "C:\SECUREDPWD\ExportedPWD-$($username).txt" $secureStringPwd = ConvertTo-SecureString -string (Get-Content $PwdTXTPath) $cred = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $secureStringPwd # --------------------------------------------------------------------------------------------------------------- [string]$TextTemplateToPut = "" [string]$pageFilename = "" [string]$pageFileTitle = "" [string]$PageTopic = "" [string]$PageTitleFull = "" [string]$pageFilename = "" [string]$PageTitleToUpdate = "" [int]$ParentNodeID = 0 [int]$PageNodeID = 0 # --------------------------------------------------------------------------------------------------------------- #GET CSV File $AllPagesToCreate = Import-Csv -Path $CSVFilePath # -------------------------------------------------------------------------------------------- #Loop for each line foreach ($PageToCreate in $AllPagesToCreate) { # --------------------------------------------------------------------------------------------------------------- Write-host " ==> Page ID", $PageToCreate.CHECKID, "- Name:", $PageToCreate.CHECKNAME , "- Topic:", $PageToCreate.CHECKTOPIC -ForegroundColor Yellow # --------------------------------------------------------------------------------------------------------------- $pageFileTitle = $PageToCreate.CHECKID $PageTopic = $PageToCreate.CHECKTOPIC $PageTitleFull = $PageToCreate.CHECKNAME if($PageTitleFull.IndexOf("(") -gt 0) { $PageTitleShort = $PageTitleFull.Substring(0, $PageTitleFull.IndexOf("(")) } else { $PageTitleShort = $PageTitleFull } $pageFilename = -join($pageFileTitle, ".aspx") $TextTemplateToPut = "<h2>Task Title: $($PageTitleFull)</h2>" $TextTemplateToPut += "<h3>Topic:</h3><ul><li>$($PageTopic)</li></ul>" $TextTemplateToPut += "<h3>Description:</h3><p> </p><p> </p>" $TextTemplateToPut += "<h3>Estimated Time:</h3><ul><li> </li></ul>" $TextTemplateToPut += "<h3>Person in charge:</h3><ul><li> </li></ul>" $TextTemplateToPut += "<h3>Starting time:</h3><ul><li> </li></ul><p> </p>" $PageTitleToUpdate = -join($pageFileTitle, " - ", $PageTitleShort) $ParentNodeID = 0 $PageNodeID = 0 Write-host " " Write-host " -------------------------------------------------------------------------------------------- " -ForegroundColor green Write-host " ---- START THE PAGE CREATION:", $pageFileTitle, "-", $pageFilename -ForegroundColor green Write-host " ---- Page Title Full:", $PageTitleFull -ForegroundColor green Write-host " ---- Page Title Short:", $PageTitleShort -ForegroundColor green Write-host " -------------------------------------------------------------------------------------------- " -ForegroundColor green # --------------------------------------------------------------------------------------------------------------- #connect to the web site using the stored credentials Write-host " " Write-host " -------------------------------------------------------------------------------------------- " -ForegroundColor green Write-host " ---- CONNECT THE SITE --- " -ForegroundColor green Write-host " CONNECTED SITE:", $HelpAndQAUrl -ForegroundColor Yellow Connect-PnPOnline -Url $HelpAndQAUrl -Credential $cred Write-host " -------------------------------------------------------------------------------------------- " -ForegroundColor green $checkpage = Get-PnPClientSidePage -Identity $pageFilename -ErrorAction SilentlyContinue if($checkpage -eq $null) { Write-Host " >>> Page does not exist or is not modern" $page = Add-PnPClientSidePage -Name $pageFilename -LayoutType "Article" } else { Write-Host " >>> We have a modern page present" $page = $checkpage } #Add text webpart to page Add-PnPClientSideText -Page $page -Text $TextTemplateToPut Set-PnPClientSidePage -Identity $page -LayoutType "Article" -Title $PageTitleToUpdate $page = Get-PnPClientSidePage -Identity $pageFilename -ErrorAction SilentlyContinue Write-host " ==>> PAGE HEADERS ImageServerRelativeUrl:", $page.PageHeader.ImageServerRelativeUrl -ForegroundColor Green $ctx = Get-PnPContext Write-host " ==>> WEB Relative URL:", $ctx.Web.ServerRelativeUrl -ForegroundColor Yellow $mySiteRelativeURL = $ctx.Web.ServerRelativeUrl $myPageRelativeURL = -join($mySiteRelativeURL, "/", $page.PagesLibrary, "/", $pageFilename) Write-host " ==>> PAGE Relative URL:", $myPageRelativeURL -ForegroundColor Yellow $page.PageHeader.ImageServerRelativeUrl = $mySiteRelativeURL +"/SiteAssets/$($PageTopic).JPG" $page.Save() $page.Publish() Get-PnPConnection $AllQuicklaunchNodes = Get-PnPNavigationNode foreach($MyNode in $AllQuicklaunchNodes) { if($MyNode.Title -eq $PageTopic) { Write-host " ->>>> PARENT - MenuNode Title:", $MyNode.Title, "- ID:", $MyNode.ID -ForegroundColor Yellow $ParentNodeID = $MyNode.ID } else { Write-host " - MenuNode Title:", $MyNode.Title, "- ID:", $MyNode.ID -ForegroundColor Green } } if($ParentNodeID -eq 0) { Write-host " ===>>>> TOPIC LINK NOT EXIST, Need to create it" -ForegroundColor Red $AddMyNode = Add-PnPNavigationNode -Title $PageTopic -Url $mySiteRelativeURL -Location "QuickLaunch" $ParentNodeID = $AddMyNode.Id } $Topicnodes = Get-PnPNavigationNode -Id $ParentNodeID foreach($MyPageNode in $Topicnodes.Children) { if($MyPageNode.Title -eq $PageTitleToUpdate) { Write-host " ->>>> PAGE NODE EXIST- MenuNode Title:", $MyPageNode.Title, "- ID:", $MyPageNode.ID -ForegroundColor Red $PageNodeID = $MyPageNode.ID } else { Write-host " ->>>> PAGE NODE - MenuNode Title:", $MyPageNode.Title, "- ID:", $MyPageNode.ID -ForegroundColor green } } if($PageNodeID -eq 0) { $AddMyNode = Add-PnPNavigationNode -Title $PageTitleToUpdate -Url $myPageRelativeURL -Location "QuickLaunch" -Parent $ParentNodeID } } Visual Result: The home page of the Help Site can be configured with the Modern News WebPart to display the last published help pages: And for one of the page, you can retrieve the content with that basic display: Post execution step: When the site is created and after the task owner enrich the content into the pages, you can use that other script to update the Page Metadata setting the author field and publication date adapted with real information of the Page Owner and not your admin account: RESOLVED: How to change Modern page Author from the "Created By" field to something else Conclusion This script was used for many internal sites to create some site with hundreds of pages. Romelard Fabrice French version: Office 365: Comment créer un jeu de Pages Modernes dans un Modern Site SharePoint Online en utilisant PowerShell depuis un fichier CSV5.1KViews2likes2CommentsModern Pages - More layout options within a section
In modern pages (Modern Team Site/Communication Site) we have some standard options for layouts. When we select a section, e.g. two columns, three columns, one-third left etc. These are all great but we often need other layouts e.g: Full page width (with different column options) 3 columns e.g.: one small left column (20%), a main middle column (60%) - for main content, and a small right column (20%) Etc. One can argue that using a Modern Team Site, "Quick Launch links" might be used as the small left column (and then you can select One-third right for content), BUT most content sites does not need the "Group" dimension - Communication sites are our preferred choice. AND of course its possible to develop some custom layouts, but that will, most likely, not comply with the recommendation from Microsoft (hence we will not go down that road again :)) So Microsoft is it possible to share any news about this topic? Can we except something new being revealed at Ignite ? Anyone else have other suggestions, ideas :) ?6.6KViews2likes4CommentsAlerts on Comments in Modern Pages?
So now that we are beginning to take advantage of Communications Sites, Modern Pages and News, we are starting to get comments on our pages - which is awesome, but... Nobody knows there are comments on the pages. Is there currently a way to get alerts/notifications (like most other modern Social Collab Tools) that a comment was made on a page? Maybe by email?Solved46KViews2likes49Commentssharepoint online modern pages - the full width layout with no banner
Just something interesting that came up in testing and might help some. On Communication Sites, if you want the new Full Width layout with no banner for some of your pages then if you create them from powershell you can set the PageLayout to Home which will give you these features. On an old classic site this will get rid of the banner and give you a tighter layout but you will still have the collaboration sidebar of course. Add-PnPClientSidePage -Name "My Comms Page" -LayoutType Home4.4KViews2likes0CommentsSharePoint Modern Page WebParts with Audiences
Hello all, I am trying to use the Modern Site Pages in SharePoint Online, but I think one feature may be missing. I have a somewhat personalized view, where I show or hide webparts using Target Audiences (based on the specific role of the User). Can I accomplish this in the Modern Site Pages feature? Is this not supported? In case this is not supported, are there any workarounds or tips on how to implement this? What I want to do is to have 3 different views inside a webpart based on which of the three roles the user has. Thanks, G.10KViews2likes14Comments