cqwp: querying a whole site looking for documents, I get also css files and png
-
11-12-2020 - |
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?
La solution
The Style Library
is also a document library technically with a template ID 101
.
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>
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange