Question

I am doing a simple CQWP in a site where I would like to query all documents. I have selected 'show items from the following site and subsites' and show items from 'document library', 'document content type' and 'document'.

My results (from a test site that is empty except 5 word documents, show those 5 documents + some css files and some png files.

Why it is giving me css and png, after selecting documents all the way?

How do I filter out documents only?

Était-ce utile?

La solution

The Style Library is also a document library technically with a template ID 101.

enter image description here

You can try following query in your query override for example to get only .docx or .pdf files

<Where>
<Or>
<Contains>
<FieldRef Name='FileLeafRef' />
<Value Type='Text'>.docx</Value>
</Contains>
<Contains>
<FieldRef Name='FileLeafRef' />
<Value Type='Text'>.pdf</Value>
</Contains>
</Or>
</Where>

OR You can filter your results through the UI as below: enter image description here

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top