Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Forcing CQWPs to list document file names

  Asked By: Garret    Date: Jul 29    Category: Sharepoint    Views: 1171

Alright, I'm about at my wit's end here.

SCENARIO
I'm trying to create a site where future and past meetings for our
organization can be listed in a central place. A big part of that
plan is to present a list of meeting documents from Meeting Workspace
subsites on the main page so that people don't have to dig to find
upcoming meeting documents. The CQWP does this nicely - with one
hitch. Rather than showing file names, it's showing a mix of file
names and other file properties (what look like partial content of
some of those files).

Is there a way to force the CQWP to list file names only, via CAML or
otherwise? I've never actually used CAML before, so I wouldn't be
sure what query to use.

I also know that it's possible to force a CQWP to show multiple
content types within a document library - specifically, I'd like to
list folders and documents only rather than just showing all the
documents irrespective of whether a folder view exists or not. I've
seen some resources on the web, but haven't gotten this to work
properly yet.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Christop Mcfadden     Answered On: Jul 29

> Is there a way to force  the CQWP to list  file names  only, via CAML or
> otherwise? I've never actually used CAML before, so I wouldn't be
> sure what query  to use.

Think I have this figured out. I missed a step in that I didn't
change the style library  entries - the query was fine the way I had it
set up, but the entry in the Style Library > XSL Style Sheets >
ItemStyle.xsl was defined to point at something other than @Name. For
people looking for a similiar solution, take a look at line 19 or so
in that file  - I changed that declaration to read:

<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Name"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>

This seems to work properly.

> I also know that it's possible to force a CQWP to show  multiple
content  types within a document  library - specifically, I'd like to
> list folders  and documents  only rather than just showing  all the
> documents irrespective of whether a folder  view exists  or not. I've
> seen some resources  on the web, but haven't gotten this to work
> properly yet.

Setting a QueryOverride property in the CQWP seems to make this work
properly - the code is:


<property name="QueryOverride" type="string">
<![CDATA[<Where><Or><Eq><FieldRef Name="ContentType"/><Value
Type="Text">Document</Value></Eq><Eq><FieldRef
Name="ContentType"/><Value
Type="Text">Folder</Value></Eq></Or></Where>]]>
</property>

Problem appears solved

 
Didn't find what you were looking for? Find more on Forcing CQWPs to list document file names Or get search suggestion and latest updates.




Tagged: