Displaying articles from more than one site in one repeater

Mateusz Żebrowski asked on June 2, 2015 14:13

I have following scenario: I have two sites where I have articles (page types). On the third site I'd like to display articles from both using one repeater. Is it possible?

Correct Answer

Brad Vrudney answered on June 2, 2015 17:37

the tooltip for the site property says you can't reference all sites: "Defines the website (specified by its code name) from which to load the content. If left empty, the current site is used."

You could aggregate the data using a query:

  1. Add a Query Data Source web part
  2. Create a new query SELECT ##COLUMNS## FROM select * from View_CONTENT_Article_Joined WHERE ##WHERE## for the webpart
  3. Add the columns you want to return in the columns field on the webpart
  4. Add the where condition to the webpart field: nodesiteid = x or nodesiteid = y
  5. Add basic repeater
  6. set the datasource name of the basic repeater to the datasource created in step 1
0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on June 2, 2015 16:42

Yes you can, make sure you don't set your site property in the web part and set the path to /% and you should get all articles for all sites.

0 votesVote for this answer Mark as a Correct answer

Paweł Górka answered on June 2, 2015 17:08

@Brenden Kehren - Can You leave site property empty? I only have "(current site)" and list of all my sites. There is no possibility (drop down list) not to select an item in repeater.

0 votesVote for this answer Mark as a Correct answer

Vic Carter answered on June 2, 2015 17:36

I have done this in the past using query repeaters. All sites use the same document type so I simply specify what documents I want and from where using the where clause in my datasource web part. This allows a single query and transformation to be used on multiple sites.

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 2, 2015 17:44 (last edited on June 2, 2015 18:42)

Brad is correct, I went back and checked and I used a query repeater with a query like Vic had stated not a standard document repeater.

0 votesVote for this answer Mark as a Correct answer

Vic Carter answered on June 2, 2015 18:10

I think I meant to say Basic Repeater connected to a Datasource web part. I am pretty sure this is the recommended way of using queries with repeaters.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.