Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to display columns from 2 different lists in a site in CQWP. Most of the blogs and MSDN articles asks to modify the xslt file, ContentQueryMain.xsl and ItemStyle.xsl, for displaying additional columns. When I opened my site in SPD, I cannot find the Styles Library folder. Is there any specific settings? Also all the articles displays example to show additional column from single list. I have 2 lists with same columns, Title and Description (Multiline rich textbox) and I want to display basically Description in CQWP. Please help.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The ContentQueryMain.xsl and ItemStyle.xsl are located in the Style Library in the RootSite of the sitecollection. Do not update the default styles defined is those files (others may depend on it). Rather add a new style to the file, or copy the files and update the references in the CQWP to the new XSL-files. To do this: export the webpart and update the corresponding properties: HeaderXslLink, ItemXslLink and MainXslLink.

In order to query multiple lists you must override the <property name="ListsOverride" type="string" /> value in the webpart definition file. To do this, export the webpart. Open the file with your favorite xml/texteditor (notepad? visualstudio?). And update the property to: <property name="ListsOverride" type="string"><![CDATA[<Lists><List ID="31A7C09D-52CC-4585-B998-A3F180A9BD07"/><List ID="7382D66D-2E4C-47CB-A95C-5EECD68F5E61"/></Lists> ]]></property>. Use the ID's of the lists you want to query. When done import the webpart again. (source)

share|improve this answer
    
Thanks a lot. Just one more query. Is it possible to display the top 1 item from each list rather than all list items? –  Ashish Oct 21 '11 at 9:33
    
Hmm, that depends on the data in your lists. And you probably have to write your own CAML-query (use the QueryOverride property). –  Dribbel Oct 21 '11 at 9:52
    
Thanks a lot!!! –  Ashish Oct 21 '11 at 10:11
    
I am still not able to display rich text content. I modified all settings. I can see my formatted text in textual format with some style sheets. Any help? –  Ashish Oct 21 '11 at 11:06
1  
Rich Text is stored as HTML in the Database, use <xsl:value-of select="somevalue" disable-output-escaping="yes" /> to display it. Otherwise all special char will be html-escaped (& -> &amp;) –  Dribbel Oct 21 '11 at 11:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.