Skip to main content

Microsoft Enterprise Content Management (ECM) Team Blog : Con...

Popularity Report

Total Popularity Score: 0

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Rank

Related Lists

Bookmark History

Saved by 19 people (-7 private), first by anonymouse user on 2007-02-05


Public Sticky notes

Hi Marcus, to answer your questions:

1) When you tell the Content Query web part to ask for a set of fields, via CommonViewFields as above, you need to use the internal name of the fields.  SharePoint's UI shows you the display name of the fields, but stores the internal name in the DB.  Usually the internal name and the display name match, but certain characters (like spaces) are encoded.

An easy way to sneak a peek at what the internal name of a field is: when you visit the Site Column page for a particular column, the URL displays the internal name of the field.  In this case it's "field=Body%5Fx0020%5Fcontent", which is just an encoded way of saying "Body_x0020_content".

2) This is one of the quirks of XML/XSL, namely certain characters getting encoded differently when getting passed as XML to the XSL to render.  One easy way to see exactly what the XML looks like that the XSL has to render is to insert the markup I have in the example above into your Item Style, and that will render out the field names:

<xsl:for-each select="@*">          

  P:<xsl:value-of select="name()" />

</xsl:for-each>

This will yield all the fields you can render by their name, including in this case "Body_x005F_x0020_content".

Ian, if you have questions about how you can utilize the web part for your scenarios, feel free to post a comment describing what you're trying to do, and I can give you some pointers.

Highlighted by mhasan

Hey Robert, you can configure the CQWP to use more than three filters  by modifying the "QueryOverride" property to use your custom CAML query for filtering. The CAML query can have any number of filter fields and values

Highlighted by overhols

Thanks for your answer, but I've managed to find out how to add the custom columns to the CQWP using the AdditionalFiltersField!

Highlighted by overhols

Hi, I'm trying the same as Robert: use more than 3 filters.

I'm doing like that:

protected override void OnInit(EventArgs e)

       {

           base.OnInit(e);

           this.QueryOverride = @"<Where><Eq><FieldRef Name=""isFull"" /><Value Type=""Boolean"">0</Value></Eq></Where>";

       }

What could be wrong? It doesn't filter anything. Thanks!

Highlighted by overhols

Hi Pablo, do you get the same effect if you specify the QueryOverride property in the .webpart XML, instead of programmatically?

Highlighted by overhols

Hi Somesh, you can configure the web part's ListsOverride property to pull from specific lists, based on list ID.  You can find more information about the property here: http://msdn2.microsoft.com/en-us/library/aa981241.aspx

Highlighted by overhols

Hi Adam,

You can achieve your scenario by extending the CQWP and overriding the "ModifyXsltArgumentList" function to pass a new parameters (List Name) down to the XSLT engine.

protected override void ModifyXsltArgumentList(ArgumentClassWrapper argList)

argList.AddParameter(columnName, namespace, value);

Adri Verlaan [MSFT]

Highlighted by overhols

You can do this by extending the Content Query Web Part and assigning the filter values during OnLoad() of the web part.

Highlighted by overhols

http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx

Highlighted by overhols