Recently I came across an issue on applying filter on a content query webpart(CQWP) which was configured to show list items from Posts list. The filter which needs to be applied was against the Category column of the post so that the webpart shows on posts of that category.
So I choose,
but when I click Apply button, the webpart threw an error.
To solve this error, and to apply the filter properly we need to add an additional filter property on the .webpart file. Export the webpart to hard disk, open the .webpart file in any text editing tool, find the property tag with name “AdditionalFilterFields”
Replace that with
Actually we need to add additional filter field PostCategory, which is the internal column name of the category field of posts.
Now save the .webpart file and import this to the webpart page, after this if we go to the modify webpart, and in the additional filter column we will find the PostCategory displayed,
Choose that PostCategory, and apply the filter logic,
Click OK or Apply button to make the changes.
That’s it, now the CQWP will show the posts where category contains Category 1,
No comments:
Post a Comment