How to: SharePoint Online Branding & News Center using Visual Studo Part 3 of 4

This is part 3, we will make the Web Part that show all news on the Start Page and in the Archive.

INFO: I will do this with a Content Query Web part but i know that Content by Search is available in Online now and that can be an option.

Part 1: Add a custom master page to enable branding

Part 2: Create the news page library with all content types that are needed.

Part 3: Create a news flow web part to be used in both the Start Page and the Archive.

Part 4. How to deploy and set this up in SP Online.

Before we get started make sure you have read Part 1 and 2 so that  you follow what we will do next.

  1. In FeatureElements -> Style Library – > SharePointOnlineNews -> XSL Style Sheets Create a .xsl file (You can create one from notepad and then move/save it in to the project as we done before with the master.). Call it OnlineNewsItemStyel.xsl
  2. Open the .xsl file and Paste the following code. This code describes how the web part will function. You can modify the content of this file, like classes and Date format etc.
  3. Under FeatureElements add a folder called WebParts, in that folder add New-Item -> Web Part, call it “OnlineNewsFeed”
  4. Edit the web parts Elements.xml and change the <Property Name=”Group” Value=”Online News” />. Save and close.
  5. In your Web part, open the file called OnlineNewsFeed.webpart and replace all code with this. On line 101 make sure the URL to the .xsl file is correct if you have other names than this project.
  6. Make sure your web part is in the Activate.Online.News web part and Not in the Activate.Branding.

If you have done every thing right, then you can deploy and you should have a new Web part to show your news with 🙂

Next step “Step 4” is to Configure the news in SharePoint.

Leave a Reply

Your email address will not be published. Required fields are marked *