Hi i wanted to add a web part on the homepage of the site which should add up the links of the pages which are added to the site automatically once the page has been created is this possible with jquery or javascript since we don't go for server side solutions in our environment. will this be possible with content query or editor web-parts. I am using SharePoint 2010.Thanks in advance.

  • Do you want to display all the links to pages on the homepage, or just display the number of page links? – clk Aug 13 '15 at 23:43
  • @ clk i want to show the links of pages in a web part – SPLearner Aug 14 '15 at 12:09

You can do this using a Content Query Web Part. Add the Content Query Web Part to the page where you want to display a list of the links to other pages. Then open the web part properties and expand the Query section. For the Source: section, select the Show items from all sites in this site collection option. Then in the List Type: section, select Pages Library. Here's a screenshot of the property configuration:

Content Query Web Part properties

At the bottom of the web part settings pane click Apply then Ok.

  • i tried this already but my scenario is I have to get only particular template based pages not all of them this option in CQWP gives all the links in the pages library I am looking to bring only work-space template based pages not all.Thank you. – SPLearner Aug 14 '15 at 15:55
  • 1
    Do you mean the work-space site template? Or do you have a custom created work-space page template? If you have a custom created page content type, then you can choose that under the Content Type: option in the Query section of the CQWP. – clk Aug 14 '15 at 16:48
  • Its just work-space site template – SPLearner Aug 14 '15 at 16:49
  • 1
    Ok, with that additional information then it doesn't look like there's an OOTB way to do what you want. You can use a web service to get all the site templates and filter by the specific template you want, but I'm not completely sure how to do that. It looks like you could also use the Table of Contents Web Part and then develop a custom XSL stylesheet to get just those sites. Check out this article for more info sharepoint.stackexchange.com/questions/3884/… – clk Aug 14 '15 at 17:24
  • I have gone through that site and got all the sub-sites but I am not sure on how to get the particular template based sites. Thanks for your brief responses. – SPLearner Aug 14 '15 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.