I have a SharePoint 2019 site and I want to customise its home page (modern page) so as to suit a particular user’s requirement. I need the hero web part to contain the most frequently visited links of a user and allow the user to drag and drop those links wherever he wants. Is it possible? if yes, please help. Images are attached for reference.
Use the following PnP PowerShell to enable/disable the needed features:
# Connect to a site
$cred = Get-Credential
Connect-PnPOnline -Url https://[tenant].sharepoint.com/sites/siteurl -Credentials $cred
# Prevent site pages at web level
Disable-PnPFeature -Identity B6917CB1-93A0-4B97-A84D-7CF49975D4EC -Scope Web
# And again enable site pages at web
#Enable-PnPFeature -Identity B6917CB1-93A0-4B97-A84D-7CF49975D4EC -Scope Web
Adding “modern” pages
// pagesLibrary is List object for the “site pages” library of the site
ListItem item = pagesLibrary.RootFolder.Files.AddTemplateFile(serverRelativePageName, TemplateFileType.ClientSidePage).ListItemAllFields;
// Make this page a “modern” page
item[“ContentTypeId”] = “0x0101009D1CB255DA76424F860D91F20E6C4118”;
item[“Title”] = System.IO.Path.GetFileNameWithoutExtension(“mypage.aspx”);
item[“ClientSideApplicationId”] = “b6917cb1-93a0-4b97-a84d-7cf49975d4ec”;
item[“PageLayoutType”] = “Article”;
item[“PromotedState”] = “0”;
item[“CanvasContent1”] = “<div></div>”;
item[“BannerImageUrl”] = “/_layouts/15/images/sitepagethumbnail.png”;
item.Update();
clientContext.Load(item);
clientContext.ExecuteQuery();
Thanks for this little discussion, as I had been searching for the similar answer. Besides, I was also looking for any help to Change AOL Password, it will be grateful.
You cannot modify the out of the box web hero web part. If you want to do this, this is something you will have to build custom using SPFx.
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview
Thank you for your answer, but, is the SPFX web part compatible with SP2019? because I tried that and couldn’t get a way to embed it in the sharepoint site