Content query web part filtering on multiple content types

Jonny
  • Content query web part filtering on multiple content types Jonny

    Is it possible to use the Content Query web part to filter on multiple specific content types that do not have a parent/child relationship?

    I have a requirement to show Events (from a calendar) and Announcements (from an Announcement list) aggregated in the same area but as these come from two different branches in the content type tree, I can't do this via configuration of the web part.

    Would I be able to do this with a custom CAML query after exporting/re-importing the web part xml? Also I noticed the following two XML clauses in the webpart.xml file:

    <property name="ContentTypeName" type="string" />
    <property name="ContentTypeBeginsWithId" type="string" />
    

    Does anyone know if these can take multiple values and if so what is the format?

    Are there any other implications to be aware of i.e. do the content types need the same site columns for the fields you want to display?

    I'm looking to do this in SP2010 but would be interested to know if the same applied for MOSS.

Related questions and answers
  • ;importErrorMessage>Cannot import this Web Part.&lt;/importErrorMessage> &lt;/metaData> &lt;data> &lt;properties> &lt;property name="Title" type="string"&gt;ItemViewTrackerWebPart</property> &lt;property name="SolutionId" type="string"&gt;f5984dff-f7c0-4108-8c08-671bbb9b5df0&lt;/property> &lt;property name="AssemblyFullName" type="string"&gt...;properties>" + "&lt;property name=\"Title\" type=\"string\"&gt;ItemViewTrackerWebPart</property>" + "&lt;/properties>&lt;/data>" + "&lt;/webPart>&lt;/webParts>

  • ); Update: I've built a C# console app which creates all lists / lookup columns / content types and add the lookup column to corresponding content type. Result: same thing, same magic number 13. Anyone...So I did create on an SPWeb 20 custom lists and then a tasks list. For each of those 20 lists I've created 20 site lookup columns. I then created 20 Content Types based on Task content type... and not the id) &lt;Query> &lt;Where> &lt;Eq> &lt;FieldRef Name='Relaterat_x0020_till_x0020_avtal' /&gt; &lt;Value Type='Lookup'&gt;Test avtal</Value>

  • as expected. When I try to add a new item to the list, the list form only shows the Title field from Item. Now, here's the weird part. If I add a second content type to the list (through the UI), the list form suddenly works correctly. This makes me think there's something wrong with my content type. Here's what I'm working with. Some names have been changed to protect the innocent. &lt;ContentType.... Scoped to Site. Registration: contains a ListTemplate and a ListInstance that just modifies a basic Custom List to enable content types and add my custom content type. Scoped to Web. Here's what's

  • ;Property Name="Group" Value="Custom" /&gt; &lt;/File> &lt;/Module> &lt;/Elements> IdeaEditor elements.xml &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Elements xmlns="http...="GhostableInLibrary" &gt; &lt;Property Name="Group" Value="Custom" /&gt; &lt;/File> &lt;/Module> &lt;/Elements> IdeaGrid elements.xml &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Elements... to be listed under the custom group. Any ideas on how I can debug this? Any constructive advice is greatly appreciated. Home elements.xml &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Elements xmlns

  • I can create a CQWP for the Announcement content type, but when I export the .webpart and add &lt;property name="CommonViewFields" type="string"&gt;Expires,Date;Body,text</property> In my ItemStyles.xsl I have added this to show all the returned fields &lt;xsl:template name="ShowXML" match="Row[@Style='ShowXML']" mode="itemstyle"&gt; &lt;xsl:for-each select="@*"&gt; &lt;br /&gt; Name: &lt;xsl:value-of select="name()" /&gt; &lt;br /&gt;Value:&lt;xsl:value-of select="." disable-output-escaping="yes"/&gt; &lt;/xsl:for-each> &lt;/xsl:template>

  • ; &lt;FieldRef Name="ID" /&gt; &lt;!-- Field which do not return values --&gt; &lt;FieldRef Name="Responsible" Nullable="TRUE" Type="UserMulti" /&gt; &lt;FieldRef Name="Accountable" Nullable="TRUE" Type="UserMulti" /&gt; &lt;!-- // Field which do not return values --&gt; &lt;ProjectProperty Name="Title" /&gt; &lt;/ViewFields> &lt;/View> &lt;Query>...I have created a recursive query that contains 2 multi user fields. After much thrashing, where I would add the and had my query return no results, I found that the FieldRef needed to include

  • = "Microsoft"; //The XML string containing the query request information //for the Web service string qXMLString = "&lt;QueryPacket xmlns='urn:Microsoft.Search.Query'&gt... a button in the html page is pressed. I am using the following code to query content from Microsoft Search Server 2008. My question is how to display the search results from the DataSet retrieved? I did...;&lt;QueryText language='en-US' type='STRING'&gt;" + keywordString + "&lt;/QueryText>&lt;/Context>&lt;/Query>&lt;/QueryPacket>"; SearchTest.QueryService queryService = new

  • ; &lt;File Url="myStoreComms.webpart" Type="Ghostable"&gt; &lt;Property Name="Group" Value="MyGroup"&gt;&lt;/Property> &lt;Property Name="QuickAddGroups" Value="MyGroup" /&gt...) { SPList list = web.Lists["Web Part Gallery"]; // go through the items in reverse //for (int i = list.ItemCount – 1; i &gt;= 0; i–) for(int i=list.ItemCount-1; i &gt;=0...; } } } } finally { if (site != null) site.Dispose(); } } In the feature.xml i have this below &lt;?xml version="1.0" encoding="utf-8

  • " __designer:bind="{ddwrt:DataBind('u',concat('ff2',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Comments1')}"/&gt; &lt;SharePoint:FieldDescription runat...;/table> &lt;/xsl:template> &lt;xsl:template name="dvt_1.formactions"&gt; &lt;td nowrap="nowrap" class="ms-vb"&gt; &lt;input type="button" value="Save Draft" name="btnSave...%"&gt; &lt;input type="button" value="Cancel" name="btnCancel" onclick="javascript: {ddwrt:GenFireServerEvent(concat('__cancel;__redirectsource;__redirectToList={',ddwrt:EcmaScriptEncode

Data information