Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sean Squires Program Manager Microsoft Corporation ECMS310.

Similar presentations

Presentation on theme: "Sean Squires Program Manager Microsoft Corporation ECMS310."— Presentation transcript:


2 Sean Squires Program Manager Microsoft Corporation ECMS310

3 Why the CQWP is so cool How we use it Configuring and using with custom data Tips & tricks Custom modifications we’ve done

4 Highlight why the Content Query Web Part (CQWP) is such a powerful approach for managing content in a SharePoint portal. Discuss (and demo!) some of the common configurations required to display custom field data. Illustrate some creative applications & extensions we’ve done.

5 Powerful web part for presenting and delivering data to one or more places from one or more places. With careful site design, this roll-up web part facilitates a lot of content scenarios. Use with tagging and targeting scenarios to display relevant data easily on pages throughout the site Allows you to centralize the content in the presentation layer regardless of where it resides Centralize Content Centralize Delivery List 1List 2 List 3List 4 CQWP CQWP 1CQWP 2 CQWP 3CQWP 4 List And combined: rolling up multiple lists across multiple web parts

6 Microsoft Web (MSW) Company portal Employees use MSW to find information, stay informed and make productive use of the intranet MS Library (MSL) Library portal Employee’s primary access point to business, marketing & technical research resources HRWeb (personnel) LCAWeb (legal) InfoWeb (field sales) ITWeb (IT Help) FinWeb (financial)

7 Rolling up select items from single/multiple sources

8 Re-using centralized content: custom queries are used to display updated & filtered views of items stored in libraries and lists w/o having to constantly edit pages Automatically building news archives pages by category and publish date w/o manual intervention

9 Use defined target and status site columns to enable content filtering and display

10 Ensuring consistent formatting/presentation across displays Styles are defined according to portal brand guidelines

11 Use the CQWP RSS feature to emit a category- filtered stream of results from news lists Use the created URL on other pages to have more control over design and placement of RSS icon

12 Targeting select content to specific audiences, like FTEs: Audiences can be defined by SharePoint or security groups, DLs, or rules-based entities Audience targeting is enabled under the Query tab and defined under the Advanced tab of the tool pane.

13 The CQWP is part of the publishing features set so this will need to be activated for the web part to be available in the gallery. NOTE: the part is not available in WSS. It can only query against single-value Lookup or Choice fields It cannot query across site collections It doesn’t support server-side pagination Unlike the Data View Web Part (DVWP) it can easily query across lists within the same site collection

14 Getting the most out of this web part requires consideration and planning of your content management needs up front Design IA Define content organization and navigation needs Plan Content Types Define your schema and filter fields Determine Roll-ups Define scenarios and property tagging Identify Display Fields Define styles

15 demo

16 It uses property settings and CAML to construct the query and the SPSiteDataQuery class to query the SharePoint site to gather results. There are a lot of properties available for configuring and customizing the query Fortunately, you don’t need to modify that many of them. To do these more advanced configurations requires modifying the file through file export or SharePoint Designer (SPD). The web part uses three primary XSL files to render aggregated query results. ContentQueryMain, ItemStyle, and Header.xsl NOTE: A fourth XSL file is available for the RSS feed. The default styles can render the following: Title, Description, LinkUrl, and ImageUrl.

17 Only a few properties are available directly through the tool pane. To modify the additional properties export the.webpart file and modify in editor of choice, and then modify the.webpart file. Once configured, you can re-import or even upload the modified file to the web part gallery Export to Configure Configure Content Type Add CQWP Export and Modify Properties Alternately, edit in SPD Import and Update Style Reference Copy a desired style to use as a template

18 Additive property used to declare your custom fields when retrieving data. This property uses an internal name, display name syntax: Title,Text;ID,Counter;Editor,User CommonViewFields Used to rename a column after the data has been retrieved and before passing to transform Useful for column name mapping to re-use existing XSL styles. DataColumnRenames There are only a few key properties we typically configure to expose and our custom content type fields. These properties are used for data retrieval expansion

19 Allows the default query behavior to be overridden. When this is used, the filtering/sorting/grouping functions of the tool pane are dimmed QueryOverride Used to retrieve additional or specific lists. When this property is used the list function of the tool pane is dimmed ListsOverride These properties override default behavior

20 Used to declare additional fields to be displayed in the filter fields pick list. This also follows the internal name, display name syntax AdditionalFilterFields Used to declare additional group/sort fields to show in the tool pane. AdditionalGroupandSortFields These properties modify the web part UI only, not the behavior.

21 Demo Export to configure additional properties

22 ALL XML inside a tag must be enclosed in a block. The default web part queries against all page libraries in a site collection. Suggest either changing default to be opt-in instead of opt-out or ensure your site publishing rules accommodate this. Upload to the web part gallery a pre- configured CQWP. Expose custom fields via AdditionalFilterFields to allow for modification via browser

23 Use CQWPs on a hidden page to emit RSS feeds whose URLs can be used elsewhere. Use consistent site columns for content filtering. If your content changes frequently keep the Cross List Query Cache Changes setting to check every time. If you need to query against >1000 lists you can add the MaxListLimit attribute to the ListsOverride property. By default this is set to 1000 There is a performance trade-off here

24 Use QueryOverride property for more complex queries The CAML query can have any number of filter fields and values (tool pane is limited to three) CAML Query Schema Reference: us/library/ms467521.aspx us/library/ms467521.aspx Using OffSetDays attribute to create a “moving window” (toolpane is limited to [Today] or a specified date

25 Use QueryOverride property for more complex queries You can only have up to two items w/in each in the clause: Home Page Top Story

26 Use ListsOverride property to query against other list types Only list templates available at the site root are enumerated. You can extract a list GUID from the list settings page (replacing %2D w/ a dash) ]]> When setting properties requiring use of the column’s internal name remember a space is represented as _x0020_ : Project_x0020_Title, Text;Project_x0020_Owner, Text;ProjectNotes, Text Cross list query cannot filter on multi-value lookup or choice fields When filtering on Yes/No data type use the value “1” and not “1”

27 Add custom styles to existing XSL files to take advantage of built in functions and template structure Careful to verify before publishing to ensure no malformed XSL XSL files need to be published for reader to view changes Use the datacolumnrenames property to re- use styles Eliminates need to create custom transformations for each custom dataset PostBody,Description ]]

28 To render HTML and not raw tags set the disable-output-escaping attribute to true: NOTE: potential security risk w/ this setting; be sure you trust content. XSL style useful for getting the internal name for a columns P: Referencing a Blog post:    }/mslibraryblog/Lists/Posts/V iewPost.aspx?ID={@ID}"> { "@context": "", "@type": "ImageObject", "contentUrl": "", "name": "To render HTML and not raw tags set the disable-output-escaping attribute to true: NOTE: potential security risk w/ this setting; be sure you trust content.", "description": "XSL style useful for getting the internal name for a columns P: Referencing a Blog post: }/mslibraryblog/Lists/Posts/V iewPost.aspx ID={@ID} >

29 Modifications we’ve made to the OOB CQWP Override Extension: show additional property fields in the tool pane Dynamic Filtering: allowing overriding query w/ querystring parameter Carousel Display: tool pane options to present results in a rotating display. Source code available on CodePlex: px?ProjectName=sptoolbox&ReleaseId=11150 px?ProjectName=sptoolbox&ReleaseId=11150

30 Created an extended version with more properties exposed Added a query override call to dynamically update same page contents based on URL parameters {vendorname}

31 Created an extension to support a filmstrip display of returned results. A preliminary release that we’d like to do more with – we’ll keep the community posted.

32 demo

33 Office Visual How To: Displaying Custom Fields in CQWP in Office SharePoint Server 2007: Configuring CBQ (ECM blog post, G. Perantatos): ng-and-customizing-the-content-query-web-part.aspx ng-and-customizing-the-content-query-web-part.aspx How to: customize the CQWP by using Custom Properties (MSDN article): Building a News Workbench on MOSS 2007 (ECM blog post, S. Squires): a-news-workbench-on-moss-2007-part-1.aspx a-news-workbench-on-moss-2007-part-1.aspx



36 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Download ppt "Sean Squires Program Manager Microsoft Corporation ECMS310."

Similar presentations

Ads by Google