Filter Content Query Web Part by file type
Posted
Tuesday, February 26, 2008 4:44 PM
by
Itay Shakury
CQWP doesn't have a "file type" property in it's filter drop down. This is how you add it:
- Insert a CQWP to a page and configure it as you would like.
- Export the web part and save it as ".webpart" file on your local computer.
- Open the ".webpart" file in a text editor. (I use SharePoint Designer)
- Look for the following line:
<property name="CommonViewFields" type="string" /> - Replace it with the following line:
<property name="CommonViewFields" type="string">DocIcon,Lookup</property>
This will make the CQWP retrieve also the DocIcon field that basically include the file extention. - Look for the following line:
<property name="AdditionalFilterFields" type="Lookup" null="true" /> - Replace it with the following line:
<property name="AdditionalFilterFields" type="Lookup" >DocIcon</property>
This will make our CQWP to allow you to filter by our newly added DocIcon field through the filtering UI in the web part's toolpane. - Save the file.
- Go to a sharepoint page and import the modified ".webpart" file into your page.
