Intro to SharePoint 2010 / 2013 Content Query Web Part

  • 15,713 views
Uploaded on

My updated presentation

My updated presentation

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • Nice job Kim, thanks for sharing at SharePoint Saturday
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
15,713
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
123
Comments
1
Likes
9

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Who’s here today?New to SharePointExisting Users?Developers?Content Owners?End Users?Decision Makers/PM’s?2010?2007?2003?Here because you love SP?Here because you hate it?
  • Why did I pick a session about one Web Part?True power of SharePoint – puts it in user handsMost under-utilized because 2007 was hard to use and you HAD to know XSLT – it is code in spite of what developers sayMost importantly – shows the importance of good architecting – content types, organizing how you’re going to use the system.Can create simplified “reports, dashboards and ways to consume dataI hope to generate some ideas on ways that you can use SharePoint within your own organization
  • Every business has some kind of data
  • And most companies have an organized chaos situation
  • A smart person talked you into organizing you date into a site collectionYou organize that data into a meaningful way for your usersBut what if you need to get data out of this site collection…Sure it could take a few minutes to get information out of each site….but what if….
  • The CQWP allows you to collect data from each of your sites and put them all together in a meaningful and often visually appealing way…out of the box
  • Multiple on one pageYou can have multiple dispensers on one page
  • Custom CQWPOr customize it to make it look really cool. Customizations are outside the scope of this presentation.
  • All announcements are displayed on our sites home page, each department filters announcements ..hr = new hires, sales = contract announcements, etcContacts, Documents and Calendar filtered by Departments
  • This is a perfect example of how you can make the same concept in two different ways in SharePointThis can be a mix of some CQWP and some manual editing, or it could easily be all CQWP’s with you add image library and links list Lobbyist
  • This example shows a smaller firm that has one person managing content. Instead of having 4 different lists to manage, there are 5 different CQWP ‘s that all feed from the same list, but are filtered on different criteria
  • One Links list for all linksDiscussions displays private and public discussions that you have access to – security trimmed
  • Goals SnapshotsTraditional SP Task listRollup provides snapshot of information for leadership for high level goals across departments
  • There were over 300 items with “-“, an incomplete description or a duplicate description in the summary field that is displayed in our custom web part and search results.Validation or unique values were not viable options in this case.
  • There were over 400 pages and documents that did not have a published version just two weeks before go live
  • Pay attention to the new fields availablein 2010. Use the question mark next to the “Additional Filters“ label to see the exact wording and how to use it.PageFieldValue – uses the current value of a field on the current page.PageQueryString – allows you to grab the value of a query string in the URL. – this can be used to create a dynamic filter for CQWP, i.e.PageQueryString: fieldnameCould use summary links web part to show categories of items and when click on summary link, the page changes the filter: Good Example/Explanation of this: http://blog.wortell.nl/wortell/faq-with-out-of-the-box-cqwp-in-sharepoint-2010/
  • Slot = variable declared in XSLT fileSlots are the new way of binding data to the Item Style in the CQWP which is pretty convenient since it saves you from editing hidden CQWP properties like CommonViewFields and DataColumnRenames like you had to in MOSS 2007 in order to include custom fields in your content aggregation.Show example of each styleGroup Styles: Large Text, Small Text, Banded, Centered, Separator, WhitespaceItem Style: Image on Left, Title & Description, Title Only, Title with Background, Bulleted Title, Image on Right; Image on Top; Image on top, Centered; Large title; Image only, clickable; Image only, not clickable; Fixed image size; Title, description and document iconNOTE: Can only group by one and show 3 fields OOB, which is why we customize.
  • If you have two fields that “appear” the same, look at the drop down.
  • Allow Connections means that data can be passed between the Web Part in question and other Web Parts on the pageExport Mode: Choosing Non-sensitive data only will strip out any data marked as sensitive, and package the rest for the exportExport Options: - Do Not Allow - Non-Sensitive Information - All DataTitle URL: link to anywhereThe Description input field corresponds directly to the Title in that the text you enter here will also appear upon title mouseover. Textyou enter into this description field are searchableHelp URL: link to help documentationMenu options available in the dropdown are Modeless (the default), Modal, and Navigate: Modeless opens a popup window that allows users to continue working "behind" the popup in other windows while the popup remains open. Modal opens a popup window that users must manually close before they're able to continue working. Navigate doesn't open a popup at all, but navigates directly to the help content by refreshing within the already open window. Catalog Icon Image URL allows you to include a small image (with a maximum size of 16x16 pixels) by including the path to the desired image file in this input field.Title Icon Image URL allows you to add an icon (with the same 16x16-pixel limitation) to the title bar of the Web Part by including the path to the desired image file in this input field.Import Error Message is the message that will be displayed to users if the Web Part fails to render. The default error message, as you can see, is "Cannot import this Web Part," but this input field gives you the ability to customize the error message to suit your needs.The Target Audiences input allows to specify the audience for whom the Web Part will display. NOTE: if the CQWP is embedded in the Page Layout, users will not be able to interact with some of these options
  • Site Feature – Office SharePoint Server Publishing if not using Publishing template
  • Cannot filter by multi-select MMDOnly allow “is equal to”
  • This error message usually means that you are querying items other than pages. Delete the “URL Path” in the Link field. Sharepoint will automatically generate a new link for you.
  • “CommonViewFields” – If you need to show more fields, export web part, add more fields here, then uploadWe look for the property called "CommonViewFields". This property makes the web part request additional fields, on top of the "base" ones it asks for out of the box. We can edit this property and specify one additional field to ask for, namely the Body field.<property name="CommonViewFields" type="string">Body_x0020_content, RichHTML</property>There's a few ways you can configure this property but the most common one is "Internal name of field", followed by a comma, followed by the type of the field. If you want more than one, add a semicolon between each pair. Note:OOB Additional Filters does not include “Page Content or “Page Layout” but you can group by them.
  • Found onhttp://blogs.sharepointguys.com/brendon/sharepoint-2007/programming/connecting-the-cqwp-without-changing-itemstyle-xsl/ <webParts><webPartxmlns="http://schemas.microsoft.com/WebPart/v3"><metaData><type name="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" /><importErrorMessage>Cannot import this Web Part.</importErrorMessage></metaData><data><properties><property name="Title" type="string">Custom XSLT Style Content Query WebPart</property><property name="Description" type="string">Adds other templates to the ItemStyle.xsl</property><property name="ItemXslLink" type="string">/Style Library/XSL Style Sheets/DevCowItemStyle.xsl</property></properties></data></webPart></webParts>
  • A quick way to do show rich text in a field would be to search the file for the text <xsl:value-of select="@Description" /> Add disable-output-escaping="yes"inside the tag, so that the end result is: <xsl:value-of select="@Description" disable-output-escaping="yes" />
  • Checks to see if there are any items after the current item, if yes, sets div class to allow us to target with css, Otherwise, if it is the last one, display a button
  • Quick way to render name of fields getting passed add to the following style<xsl: for-each select=“@*”> <xsl: value-of select = “name( )”/></xsl: for-each>Add it to the code above “Display Title” variable to see a list of fields being passed to the web part
  • Organized and consumabledata = happy users

Transcript

  • 1. Intro to 2010/2013Content Query Web PartThe sweetest way to manage your content inSharePoint
  • 2. About Me SharePoint Power User since 2001 Huge Gator Fan Graduated with BS in Advertising from University ofFlorida Consultant at Twitter @KimFrehe Microsoft Certified:Passionate aboutSharePoint
  • 3. AgendaWhat is it?Using CQWPRequirements &RecommendationsTips & Tricks
  • 4. Data, Data Everywhere
  • 5. How do users find data?
  • 6. Organize
  • 7. Find
  • 8. Display
  • 9. Make it Pretty
  • 10. Web Analytics Web Part - What
  • 11. Content Query Web Part - How
  • 12. Filter by Version < 1
  • 13. AgendaWhat is CQWP?Using CQWPRequirements &RecommendationsTips & Tricks
  • 14. Add a CQWP
  • 15. Edit the Web Part
  • 16. Your web part
  • 17. Source Displayinformation fromall sites in sitecollection, One “parent”with children orjust one site Can displaybased on list justone list
  • 18. AgendaWhat is CQWP?Using of a CQWPRequirements &RecommendationsTips & Tricks
  • 19. Site Collection Feature:Access Level:Requirement
  • 20. Content TypesManaged MetadataRecommendation
  • 21.  Copy Item Style.xsl
  • 22. AgendaWhat is CQWP?Using CQWPRequirements &RecommendationsTips & Tricks
  • 23.  Error Message Versioning
  • 24.  If “Due Date” does not work,try “Due Date [Core Task and IssueColumns]” Expiration date:_dlc.ExpireDate
  • 25. Change Style Sheet web part uses1.Copy OOB Style Sheet and name2.Export CQWP to desktop3.Open file in NotePad4.Replace itemstyle.xls with<newname>.xls5.Add the following property:<data><properties><property name="Title" type="string">Custom XSLT Style Content QueryWebPart</property><property name="Description" type="string">Adds other templates to theItemStyle.xsl</property><property name="ItemXslLink" type="string">/Style Library/XSL StyleSheets/<newname>.xsl</property></properties></data>
  • 26. Create Custom Item StyleTemplate1. Copy all text in one template from<xsl:template name="Default" match="*"mode="itemstyle">To</xsl:template>2. Rename your new template
  • 27. Create Custom Item StyleTemplate3. Look for Description and add new slots4. Add custom slot:<div class=“item”><xsl:value-of select=“@fieldname”/></div>
  • 28.  Format Date:At the top:xmlns:ddwrt=“http://schemas.microsoft.com/WebParts/v2/DataView/runtime”In the Template:<xsl:value-of select="ddwrt:FormatDate(@DueDate, 1033,1)"/>
  • 29.  Show Rich Text: disable-output-escaping="yes"Example:<xsl:value-of select="@Description“ disable-output-escaping="yes" />
  • 30. Separator in between or button after thelast: Separator:<xsl:if test="count(following-sibling::*)!=0"><div class="BulletinBoardSeparator" /></xsl:if> Button:<xsl:if test="count(following-sibling::*)=0"><div class="BulletinBoardSeeAllLink"><ahref="../Lists/Bulletin%20Board/AllItems.aspx"><img alt="See All Postings" border="0"src="/_layouts/Site/images/SeeAllPost.png"></img></xsl:if>
  • 31.  Render Names of Fields - 2007<xsl: for-each select=“@*”><xsl: value-of select = “name( )”/></xsl: for-each> Add it to the code above “Display Title” variable to see a list of fieldsbeing passed to the web part Show additional fields - 2007“CommonViewFields”<property name="CommonViewFields"type="string">Body_x0020_content, RichHTML</property>Internal names:http://sharepointmalarkey.wordpress.com/2010/10/12/sharepoint-internal-field-names-sharepoint-2010/
  • 32.  Discussion Replies - 2007:use “ItemChildCount”<property name="CommonViewFields"type="string">ItemChildCount,Lookup</property> Filter by “Yes / No” checkbox:2007 (1=Yes, 0=No) vs. 2010
  • 33. Contact MeKfrehe@rightpoint.com@KimFrehePresentation:http://slidesha.re/IEUZVj