Answers.Body: <p>Yes it is. Just include the site id of the the site in your query</p>
  
  <pre><code>set siteId = 2
  set entries = craft.entries.section('foo').site(siteId).all()
  </code></pre>
  
  <p>if you want to get the current entry for another site</p>
  
  <pre><code>set currentEntrySiteB = craft.entries.id(entry.id).site(2).one()
  </code></pre>
  
  <p>If you want to search for disabled entries (for example in CP templates) for other sites you can do</p>
  
  <pre><code>craft.entries.id(entry.id).site(2).enabledForSite(false).one()
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-09T11:33:43.090Z
Answers.Text: Is it possible to aggregate multiple site's content (for example, news stories) into one query? I don't seem to see a way to include multiple site IDs or handles in an entry query.
Answers.UserDisplayName: Stephen Hamilton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-09T11:35:45.240Z
Answers.Text: @StephenHamilton No you can't https://github.com/craftcms/cms/issues/2854
Answers.UserDisplayName: Robin Schambach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-09T12:00:47.603Z
Answers.Text: Thanks @Robin, gutted I didn't see that before getting this far with a build...
Answers.UserDisplayName: Stephen Hamilton
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-27T14:33:45.677Z
Answers.LastActivityDate: 2018-02-27T15:56:11.253Z
Answers.LastEditDate: 2018-02-27T15:56:11.253Z
Answers.UserDisplayName: Robin Schambach
Answers.Body: <p>I needed to aggregate blog posts entries from ~20 schools (multi-sites) and display them on the main site. Like others, I realised way to0 late in the development that this wasn't an out of the box feature. However by using the Twig array <a href="https://twig.symfony.com/doc/2.x/filters/merge.html" rel="nofollow noreferrer">merge filter</a> you can build an array of aggregated entries from your multi-sites. </p>
  
  <p>Then, using the <a href="https://github.com/TopShelfCraft/SuperSort" rel="nofollow noreferrer">superSort</a> plugin you can subsequently sort the merged array into whatever order you like, chronological in our case. </p>
  
  <p>On this particular multi-site setup, we use a lightswitch <code>showOnMainSite</code> that admin users can switch to the on position to select what entries are pulled through to the main site. In the example below, we use the search filter to filter the entries output accordingly. </p>
  
  <p>Here's a simplified version:</p>
  
  <pre><code>{#-- create an empty array --#}
  {% set multiSiteEntries = [] %}
  
  {#-- fetch the multi-site IDS using the getSitesByGroupId method --#}
  {% set sites = craft.app.sites.getSitesByGroupId(2) %}
  
      {#-- loop through the sites in groupId 2 using the site.id, searching for the showOnMainSite lightswitch field --#}
      {% for site in sites %}
  
          {#-- add retrieved site entries to the multiSiteEntries array --#}
          {% set multiSiteEntries = multiSiteEntries|merge(
              craft.entries().
              siteId(site.id).
              section('blog').
              search('showOnMainSite:1').
              all()) 
          %}
  
      {% endfor %}
  
  {#-- loop through our populated array of multi-site enries and use the superSort plugin to sort them chronologically --#}
  {% for entry in multiSiteEntries|supersort('rsortAs', '{{ object.postDate|date("U") }}') %}
  
      {#-- our multi-site entries output --#}
      &lt;a href="{{ entry.url }}"&gt;
          {{ entry.title }} | {{ entry.postDate|date('jS F Y')}}
      &lt;/a&gt;
  
  {% endfor %}
  </code></pre>
  
  <p>We limit each site output to 3 entries, so overall we are pulling ~60 entries in from 20 multi-sites to use as a landing page for end users to browse at a glance all the news across the 20 schools. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-11T10:20:09.003Z
Answers.Text: As of 3.2 (d017022) Craft supports this feature request in the op
  
  
    [1]: https://github.com/craftcms/cms/commit/d01702278bd84b84392e11da72aa4d0b6f4f0943
    [2]: https://github.com/craftcms/cms/issues/2854#issuecomment-471371467
Answers.UserDisplayName: Jamie Taylor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-18T11:01:36.913Z
Answers.LastActivityDate: 2019-01-18T11:01:36.913Z
Answers.UserDisplayName: Jamie Taylor
Body: <p>In multi-site is it possible to access entries between sites in the templates.  Like a feed?   ie. entry "a" on site "A" shows up in an index on site "B", and links back to the entry on site A, not a duplicate of the entry on site "B"?  </p>
  
Tags: <craft3><multi-site>
Title: Craft 3 multisite - are entries accessible between sites?
ThreadText: # Craft 3 multisite - are entries accessible between sites?
  
  (Asked by: username_0 on 2018-02-27)
  
  In multi-site is it possible to access entries between sites in the templates. Like a feed? ie. entry "a" on site "A" shows up in an index on site "B", and links back to the entry on site A, not a duplicate of the entry on site "B"?
  
  **Tags:** craft3, multi-site
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-02-27. Score: 5 | Accepted answer
  
  Yes it is. Just include the site id of the the site in your query
  
  ```
  set siteId = 2
  set entries = craft.entries.section('foo').site(siteId).all()
  
  ```
  
  if you want to get the current entry for another site
  
  ```
  set currentEntrySiteB = craft.entries.id(entry.id).site(2).one()
  
  ```
  
  If you want to search for disabled entries (for example in CP templates) for other sites you can do
  
  ```
  craft.entries.id(entry.id).site(2).enabledForSite(false).one()
  
  ```
  
  > **Comments:**
  > **username_2**: Is it possible to aggregate multiple site's content (for example, news stories) into one query? I don't seem to see a way to include multiple site IDs or handles in an entry query.  
  > **username_1**: @username_2 No you can't https://github.com/craftcms/cms/issues/2854  
  > **username_2**: Thanks @username_1, gutted I didn't see that before getting this far with a build...  
  
  ---
  
  ### Answer by username_3 on 2019-01-18. Score: 3
  
  I needed to aggregate blog posts entries from ~20 schools (multi-sites) and display them on the main site. Like others, I realised way to0 late in the development that this wasn't an out of the box feature. However by using the Twig array [merge filter](https://twig.symfony.com/doc/2.x/filters/merge.html) you can build an array of aggregated entries from your multi-sites.
  
  Then, using the [superSort](https://github.com/TopShelfCraft/SuperSort) plugin you can subsequently sort the merged array into whatever order you like, chronological in our case.
  
  On this particular multi-site setup, we use a lightswitch `showOnMainSite` that admin users can switch to the on position to select what entries are pulled through to the main site. In the example below, we use the search filter to filter the entries output accordingly.
  
  Here's a simplified version:
  
  ```
  {#-- create an empty array --#}
  {% set multiSiteEntries = [] %}
  
  {#-- fetch the multi-site IDS using the getSitesByGroupId method --#}
  {% set sites = craft.app.sites.getSitesByGroupId(2) %}
  
      {#-- loop through the sites in groupId 2 using the site.id, searching for the showOnMainSite lightswitch field --#}
      {% for site in sites %}
  
          {#-- add retrieved site entries to the multiSiteEntries array --#}
          {% set multiSiteEntries = multiSiteEntries|merge(
              craft.entries().
              siteId(site.id).
              section('blog').
              search('showOnMainSite:1').
              all()) 
          %}
  
      {% endfor %}
  
  {#-- loop through our populated array of multi-site enries and use the superSort plugin to sort them chronologically --#}
  {% for entry in multiSiteEntries|supersort('rsortAs', '{{ object.postDate|date("U") }}') %}
  
      {#-- our multi-site entries output --#}
      <a href="{{ entry.url }}">
          {{ entry.title }} | {{ entry.postDate|date('jS F Y')}}
      </a>
  
  {% endfor %}
  
  ```
  
  We limit each site output to 3 entries, so overall we are pulling ~60 entries in from 20 multi-sites to use as a landing page for end users to browse at a glance all the news across the 20 schools.
  
  > **Comments:**
  > **username_3**: As of 3.2 (d017022) Craft supports this feature request in the op     [1]: https://github.com/craftcms/cms/commit/d01702278bd84b84392e11da72aa4d0b6f4f0943   [2]: https://github.com/craftcms/cms/issues/2854#issuecomment-471371467  
  
  ---
  
  