How to effectively manage SharePoint news – Part 2

In the first Part of this article I’ve explained how to manage SharePoint news effectively using custom views, on Part 2 I’m bringing you a second approach to manage SharePoint news using what SharePoint provides out of the box.

With the method described in this article you will be able to create a managing news page using the Highlighted content web part and CAML query, a perfect solution to who don’t have access to the PnP PowerShell to create custom views.

create SharePoint news index

To create the page that will help you managing the news do the following:

  1. Create a new page and name it Manage News
  2. Add two Highlighted content web parts to the page
  3. Open the settings of the first web part
  4. Select use Custom query
  5. On the Source drop down select The page library on this site
  6. On the Query text (CAML) paste the following code and click Apply
    <View>
    	<Query>
    		<Where>
    			<And>
    				<Eq>
    					<FieldRef Name='PromotedState' />
    					<Value Type='Number'>2</Value>
    				</Eq>
    				<Eq>
    					<FieldRef Name='PageLayoutType' />
    					<Value Type='Text'>Article</Value>
    				</Eq>
    			</And>
    		</Where>   
    		<OrderBy>
    			<FieldRef Name='Modified' Ascending='False' />
    		</OrderBy>
    	</Query>
    </View>
    

    This query gets all the SharePoint news ordered by modified date

  7. Select the layout you like the most and close the property pane
    create SharePoint news index
  8. Open the settings of the second web part
  9. Select use Custom query
  10. On the Source drop down select The page library on this site
  11. On the Query text (CAML) paste the following code and click Apply
    <View>
    	<Query>
    		<Where>
    			<And>
    				<Eq>
    					<FieldRef Name='PromotedState' />
    					<Value Type='Number'>2</Value>
    				</Eq>
    				<Eq>
    					<FieldRef Name='PageLayoutType' />
    					<Value Type='Text'>RepostPage</Value>
    				</Eq>
    			</And>
    		</Where>   
    		<OrderBy>
    			<FieldRef Name='Modified' Ascending='False' />
    		</OrderBy>
    	</Query>
    </View>
    

    This query gets all the News Links news ordered by modified date

  12. Select the layout you like the most and close the property pane
  13. Save your page and publish it

create SharePoint news index

Only using what SharePoint provides out of the box you can create an index directory where you will be able to easily manage SharePoint news instead of looking for them in the Site Pages library.

If you want to check how this process was implemented have a watch the video below, if you like it and want to get more content like this don’t forget to hit the subscribe button.

Subscribe to the YouTube channel

Technology vector created by macrovector – www.freepik.com


2 Responses to “How to effectively manage SharePoint news – Part 2”

  1. Sam

    August 31, 2020

    Great work Joao! Do you have a reliable source for CAML queries with SharePoint.

    Reply

Leave a Reply


I've been working with Microsoft Technologies over the last ten years, mainly focused on creating collaboration and productivity solutions that drive the adoption of Microsoft Modern Workplace.

%d bloggers like this: