Pergunta

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.

Foi útil?

Solução

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)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top