Content Query Webpart In SP

we can use the Content By Query Web Part to Collection data from multiple data sources across your Web site, and then present it all in one place. Before you configure and customize the Content By Query Web Part, you should consider the branding and site design you want to achieve. Microsoft SharePoint Server 2010 includes three Extensible Style Language (XSL) files that you can modify to render fields in styles that the Content By Query Web Part uses to display the content it aggregates.

File Location Function
  1. ContentQueryMain.xsl
\Style Library\XSL Style Sheets\ContentQueryMain.xslOR

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\PublishingResources

  • Contains logic that generates the appropriate calls to the Header and Item templates for each item.
  • Receives all the content, parses it, and sends appropriate pieces to the ItemStyle and Header templates.
  • Maintains the structure of the Content By Query Web Part.
  • Stores data retrieved when querying content in the path /dsQueryResponse/Rows/Row.
  1. ItemStyle.xsl
\Style Library\XSL Style Sheets\ItemStyle.xslOr

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\PublishingResources

  • Contains templates that define how to display an item. These templates receive and process one row of data at a time, ensuring that the style and data in the item rows is consistent.
  • You can retrieve data about a row by using the @Property directive.
  1. Header.xsl
\Style Library\XSL Style Sheets\ContentQueryMain.xslOR

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\PublishingResources

  • Contains templates that define how to display a header and ensure the consistency of group headers.
  • Templates specified in Header.xsl receive the next item row to process, usually the first row in a group unless there are multiple columns. If there are multiple columns, the templates receive the first row of the column.
  • You can retrieve data about the next item row by using the @Property directive. You can use the $Group parameter that contains the groupby column name and the $GroupType that represents the column type of the groupby column.

About Krishana Kumar

Krishana Kumar is SharePoint Architect/Trainer having Architecture experience with high volumes at Enterprise level and global scale - creation of highly scalable solutions with global user base and geographically distributed architectural components. Good knowledge of SharePoint best practices and governance models. I hold Two Master degree in Computer Science with over 11 years of experience working on Microsoft Technologies specially SharePoint, Project, .NET and other Information Worker Technologies. Having good exposer in Client side scripting Angular.js, backbone and Node. I am currently responsible for SharePoint Infrastructure set up and leading teams in various medium and large scale projects, architecting, designing & installing SharePoint farms, developing custom components,, and providing advanced SharePoint administration and development training to teams and customers. I regularly speaks in various SharePoint User Groups and other Events. I have MCSA Windows Azure, MCSA Office 365, MCSE & MCSD SharePoint 2013, Microsoft Certified Developer (MCD) and holds MCPD, MCTIP and MCTS for SharePoint 2010, MCTS MOSS 2007 & WSS 3.0, MCPD, MCITP (EPM 2010 & 2007) and MCSD .NET.
This entry was posted in Share Point Stuff and tagged . Bookmark the permalink.