Forum Discussion

Henk Prins's avatar
Henk Prins
Brass Contributor
Sep 12, 2018

Add a category filter to Highlighted Content Webpart (news)

Hi,

 

I want to add a Highlighted Content webpart to a new page. In this webpart i want to show only news of a specific category (like only Breaking News).

 

I've read that that i can realize this by use a managed property as a filter.

 

What i've done sofar:

 

  • Created a Site Column called Categorie (= Dutch) which is a choice column.

 

Then i tried several options to edit a managed property 'RefinableStringxx', but i'm not able to change some options.

 

For example: i think i have to check the 'search' option but this is not possible in the 'RefinableStringxx' property.

 

So, questions are:

 

  1. Is this excepted behavior that i can not edit the 'RefinableString06'
  2. Should I then create a Managed Property myself? <- I've read somewhere that this will not work and i have to use the 'RefinableStringxx'.

 

So actually i'm looking for a step-by-step instruction. I've tried several things, but after trying something manuals say that it can last a few hours before changes of a managed property have effect.

 

I'm stuck, and a bit frustrated. Any help would be very, very appreciated.

 

Best regards, henk.

 

 

 

 

 

 

 

 

 

5 Replies

  • You could actually do this in a much simpler way by filtering the News web part using the Page Property you created - Categorie. You can use page properties in both the Highlighted Content and News web parts.

     

    For Highlighted Content, select the Source = Page library on this site and then filter by Page Properties. For News, scroll down to the Filter and select Page properties. One reason I like to use the News web part is that you can leverage the News web part layouts to display news that is filtered by your Category. This is a relatively new feature but it's great because if you only need to use the property in a single site, you don't need to do any schema mapping. Both web parts work with "regular" choice columns and managed metadata columns. 

    • Henk Prins's avatar
      Henk Prins
      Brass Contributor
      Hello Susan. thanks, this works like i want to. Additionally i see that i can make use of a category called 'Breaking News' by adding this option to the choice column. By checking the "Hide this web part when there is nothing to show" (Don't know the exact phrase, as I use the Dutch version) the web part will only appear when there's a news item with the category 'Breaking News'. Thanks! on to the next issue ; )
  • Hi Henk!

    Perhaps you already have tried this but here is a step-by-step that has worked for me. Hope it can help You.

     

    In SharePoint Admin Center - Choose Search and Manage Search SchemaSearch for the Property refinablestringSelect one of the properties that has not already been mapped and open itScroll down and press Add a mappingSearch for the field you want to map to the Managed Property. Select it and press OK.Now Save the Managed Property that You have mapped your field to.Edit the Web part and enter the name of the Managed Property and enter the value you want to filter on.

    Now you are done, BUT: The web part will not display any results before the items have been re-saved/re-indexed so test by editing one of the Documents and save it. Wait until the changes has been indexed (which can take some time) and then check if it is displayed in the web part.

     

    That should work.

    Best regards, Magnus

     

    • Henk Prins's avatar
      Henk Prins
      Brass Contributor
      Hello Magnus, appreciat your reply. Will test this immediately and inform you about the result! best regards, henk.
      • Henk Prins's avatar
        Henk Prins
        Brass Contributor

        Just followed your instructions, and it's pretty much what I've already don.

         

        Two things:

         

        1. Not sure though i've added new News Posts after I edited the Managed Property, so i just did this and guess I'll have to wait for the indexing
        2. I was not able to check the 'Search' option in the Managed Property. Isn't this necessary?

        Best regards, Henk.