none
displaying subsites in content query web part RRS feed

  • Question

  • I have some sites in Sharepoint 2010 and one of the sites contains five subsites.

    Now what i want to accomplish is to display those subsites within in a content query webpart but when i try this it only displays the pages within those subsites and not the subsites themselves. The subsites should be within anchor tags so when the user clicks on a subsite it takes him to that subsites landing page. The CQWP should also display a icon and a short synopsis/description like in the image.

    Thanks

    Monday, July 9, 2012 9:18 AM

Answers

  • You could consider using the Search Core Results query webpart and a fixed query of ContentClass:sts_web to display all of the sites. You'll need to set-up a custom scope to ensure that you return just the sites that you want, but the result set can then be styled using XSLT in the same manner as the CQWP. This approach however would probably not display the description you want unless it happens to appear on the front page and is in the search summary. I use this method in a blog post, albeit without the description text. http://www.myfatblog.co.uk/index.php/2012/03/xml-in-sharepoint-search-pt-2/

    Alternatively, add a custom list to each site that contains a content type that holds information to describe the site.. E.g. description and URL, then use the CQWP to style and display this information. It's not dynamic though like search would be and would need the list items to be configured whenever a site is created.

    Paul.


    Please ensure that you mark a question as Answered once you receive a satisfactory response. This helps people in future when searching and prevents the same questions being asked multiple times.


    Monday, July 9, 2012 9:30 AM

All replies

  • You could consider using the Search Core Results query webpart and a fixed query of ContentClass:sts_web to display all of the sites. You'll need to set-up a custom scope to ensure that you return just the sites that you want, but the result set can then be styled using XSLT in the same manner as the CQWP. This approach however would probably not display the description you want unless it happens to appear on the front page and is in the search summary. I use this method in a blog post, albeit without the description text. http://www.myfatblog.co.uk/index.php/2012/03/xml-in-sharepoint-search-pt-2/

    Alternatively, add a custom list to each site that contains a content type that holds information to describe the site.. E.g. description and URL, then use the CQWP to style and display this information. It's not dynamic though like search would be and would need the list items to be configured whenever a site is created.

    Paul.


    Please ensure that you mark a question as Answered once you receive a satisfactory response. This helps people in future when searching and prevents the same questions being asked multiple times.


    Monday, July 9, 2012 9:30 AM
  • you can use "Table of Contents Web Part" instead of CQWP

    Amira

    Tuesday, October 23, 2012 1:17 PM