Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to use custom metadata columns with the Content Query Web Part. I finally figured out that I apparently needed to export the .webpart xml file, edit it and then import it as a new web part.

So I made the following changes:

<property name="AdditionalFilterFields" type="string" >MinKategori</property>

and

<property name="CommonViewFields" type="string" >MinKategori</property>

According to this tip in Answer 4 here: http://go4answers.webhost4life.com/Example/filter-content-query-web-part-custom-189739.aspx

This doesn't work for some reason though. I do get the column available, but it says I haven't filled in a value, which I actually have as this image shows, but still I only get the error message:

enter image description here

What am I doing wrong?

share|improve this question
1  
it may be because it's managed metadata. –  Tom Resing Mar 15 '13 at 0:34
    
Ok, but if that's the problem it would sort of defeat the purpose, since managed metadata is what we mostly use in document libraries. Also, I have been under the impression that the CQWP should work with managed metadata columns as well... –  Anders Svensson Mar 15 '13 at 11:15
2  
Does the managed metadata column allow multiple values? –  Danny Jessee Mar 17 '13 at 23:12
add comment

4 Answers

See if this link helps you:

http://www.theroks.com/related-items-with-a-content-query-webpart/

We export the webpart. In the xml there are two elements that we must see. These are the properties; FilterOperator1 and FilterDisplayValue1. FilterDisplayValue1 has the right and expected value. However the FilterOperator1 has the value Eq. This will not do it. When multiple terms are coupled to a FAQ it will never appear in this result.

<property name="FilterOperator1"
  type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
 Eq
</property>

<property name="FilterDisplayValue1" type="string">
 [PageFieldValue: Insurrance]
</property>
share|improve this answer
add comment

Make the constraint "equals" instead of contains. I am pretty sure you cannot use the contains constraint with term sets but they still work fine if there are multiple values.

share|improve this answer
add comment

Create a Site Column of type Managed Metadata and set it to allow multiple values. Associate this site column to a custom Site Content Type. Add the site content type to your document library/list

In your CQWP : - point the query source to show items from the your document library/list you added site content type into. - Set the content type to site content type you created. - Under additional filters, set to show items when "contains all of" .

share|improve this answer
add comment

Error message

This error

You must specify a value for filters on managed metadata fields

occurs when filter value could not be specified for taxonomy field (TaxonomyFieldType or TaxonomyFieldTypeMulti types) in Content Query web part editor.

Taxonomy fields based filtering in CQWP

By default CQWP support Managed metadata fields, including the single & multi-value varieties for filtering, see for example this article for details.

Limitation for usage taxonomy fields (multiple values) for filtering in CQWP

In case of usage multi value taxonomy fields for filtering, it could be specified in web part editor when target list is selected only (see Source property in screenshot below)

For another sources (Show items from all sites in this site collection or Show items from the following site and all subsites) filtering based on multiple values taxonomy fields could be specified explicitly using properties (filter operator, filter type and filter value). See solution section below for details.

enter image description here

Solution

In your case in order to filter by taxonomy field there is no need to provide AdditionalFilterFields and CommonViewFields properties.

The following properties should be specified for filtering based on multiple taxonomy field:

FilterOperator1

Specify filter operator

<property name="FilterOperator1" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">ContainsAny</property>

FilterType1

To specify multiple taxonomy field:

<property name="FilterType1" type="string">TaxonomyFieldTypeMulti</property>

FilterValue1

Specify taxonomy field internal name:

<property name="FilterField1" type="string">NewsLocation</property>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.