Forum Discussion
Bastiaan Kortenbout
Apr 06, 2017Brass Contributor
Highlighted content webpart - Filter on managed property using Query variables
The default News webpart already shows me an overview of News articles from the current site. I want the Highlighted content webpart to show News articles from all sites below the current site. Therefore I've set the source of the webpart to "This site collection" and only show content of type "News". As expected, I only see news from the current site collection. So far so good...
I want to achive to only see News articles from subsites. Therefore, I want to filter on the existing SPWebUrl managed property, using a Query Variable. This SPWebUrl property is available when using the SharePoint Search Query tool. But this Managed Property is not available in the Managed property dropdown on the webpart settings page. There is a property in the dropdown called WebUrl, but that doesn't seem to contain a value.
Theoretically, I should be able to get the same results using the Path managed property, by checking if the value contains the link of the current site. When filtering on the Path managed property using a contains operator and value containing the URL, things get filtered as expected. But I want to set this value dynamically, and not enter a static URL manually.
When creating a query on SharePoint 2013, I was able to use: {Site}, {Page}, {User} Query variables. See link: https://technet.microsoft.com/en-us/library/jj683123.aspx
This doesn't seem to work on the Highlighted content webpart. When I do use the {Site} Query variable, I get some strange results. When applying a filter on Path contains {Site}, I get results from another Site Collection. And not even news, but documents. That is very strange, since the source of my webpart is "This site collection".
Can somebody advise on how to use the Highlighted content webpart to show News from all subsites, without setting the filter manually with a static URL?
I need this webpart to be as flexible as the old-fashioned Content Search webpart.
Thanks in advance guys!!
Bastiaan
- SchneikaIron ContributorNot possible to use dynamic Page-Filter-Properties (Filter-Tokens) like {Page.Property} in Highlighted Content WebPart. Annoying since years...
Instead i use the wellknown SPFx React Search WebParts on GitHub which are able to Filter on Page-Tokens like this:
{searchTerms} owstaxIdInternalColumnName:{Page.InternalColumnName.Label}
(in Case of Managed Metadata Column / Label) - Pontus TIron Contributor
+1 for a fix to this issue
Wanted to use this to feed documents checked out to "me" but no luck so far.
Also interesting that the highlighted content cannot get normal list items, but is limited to the different list item content types such as tasks, contacts etc. The list webpart itself is limited to lists from within the site collection, so no help there if you want to show list items across different site collections
Pontus T you can get items from anywhere. Yes the default drop down selections are limited, but you can select "ALL" for the content types and for the Sites.
Then you use the Filter section at the bottom to filter the items/content types/etc.. you want using the ManagedProperty filter.- Pontus TIron Contributor
Beau Cameron thanks a lot for that tip! I managed to fetch the list items I wanted using the the ContentType managed property. It seems strange to me that "Item" is not part of the drop down as it is the default content type for any custom list. Anyway, happy that I can grab what I need using the filter.
- Erwin KeustermansCopper Contributor
Hello Bastiaan,
There are no replies here, but did you find out somehow the answer to your question?I have no idea where to look for proper documentation on the use of "highlighted content" + "managed property filter" ,
Thx, Erwin K.
- Bastiaan KortenboutBrass Contributor
Unfortunately there is no possibility to use query variables (like: me, today, user.department)
I haven't found high quality technical documentation, besides the existing most basic user documentation.
- Erwin KeustermansCopper Contributor
thanks for answering all the same!
- Matthew JonesBrass Contributor
I am in need of a solution to this as well, anyone any ideas?