Answers.Body: <p>I doubt this is possible in Twig by default because you have two different Element types, thus you'll need to different instances of the ElementQuery to populate all models correctly. I think you'll need to create your own pagination. That being said <code>Element::find()-&gt;all()</code> will throw an error </p>
  
  <blockquote>
    <p>Cannot instantiate abstract class craft\base\Element</p>
  </blockquote>
  
  <p>Thus you'll have to Query for your elements in your own</p>
  
  <pre><code>// get all possible element ids
  $sectionId = X;
  $query = (new Query())
      -&gt;select('elements.id')
      -&gt;from('{{%elements}}')
      -&gt;leftJoin('{{%elements_sites}}', 'elements_sites.elementId = elements.id')
      -&gt;leftJoin('{{%entries}}', 'entries.id = elements.id')
      -&gt;where(new OrCondition([
          ['=', 'entries.sectionId', $sectionId], &lt;-- your section Id
          ['is', 'entries.sectionId', null],
      ]))
      -&gt;andWhere(new OrCondition([
          ['=', 'elements.type', \craft\elements\Entry::class],
          ['=', 'elements.type', YourCalenderClassComesHere],
      ]))
      -&gt;andWhere(['elements_sites.siteId' =&gt; 1])
      -&gt;limit(10)
      -&gt;offset(0)
      -&gt;column();
  
  // populate entry by Id
  foreach ($query as $elementId){
      $element = Craft::$app-&gt;getElements()-&gt;getElementById($elementId);
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-27T19:23:01.653Z
Answers.Text: Wow, thanks Robin. What a complete answer. I've yet to test myself with Craft Plugin work so I'll give writing one a go with this! Assuming you'd recommend this to be implemented in plugin form?
Answers.UserDisplayName: Jay
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-27T19:24:45.093Z
Answers.Text: You need to implement it via plugin or module, these are the only ways to access custom php code. There are a few other checks you might want to include. The easiest is to run `Entry::find()->getRawSql()` to see all conditions Craft includes by default
Answers.UserDisplayName: Robin Schambach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-27T19:35:13.707Z
Answers.Text: This is great. Thanks for your help. I'll be sure to try and write my first plugin with this then! Cheers again. 
Answers.UserDisplayName: Jay
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-25T12:42:58.160Z
Answers.LastActivityDate: 2018-05-25T12:42:58.160Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I have installed the Calendar plugin and I'd like to search across event entries from this plugin and from channel/section entries across the base Craft 3 site.</p>
  
  <p>However, I am getting the usual Limit-Array error when trying to paginate the results.</p>
  
  <p>Is there a method for paginating multiple search results in Craft 3? I haven't come across a way to do this in any current questions or Craft 3 Docs.</p>
  
Tags: <craft3><search>
Title: Paginate search results after combining sections in Craft 3
ThreadText: # Paginate search results after combining sections in Craft 3
  
  (Asked by: username_0 on 2018-05-25)
  
  I have installed the Calendar plugin and I'd like to search across event entries from this plugin and from channel/section entries across the base Craft 3 site.
  
  However, I am getting the usual Limit-Array error when trying to paginate the results.
  
  Is there a method for paginating multiple search results in Craft 3? I haven't come across a way to do this in any current questions or Craft 3 Docs.
  
  **Tags:** craft3, search
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-05-25. Score: 2 | Accepted answer
  
  I doubt this is possible in Twig by default because you have two different Element types, thus you'll need to different instances of the ElementQuery to populate all models correctly. I think you'll need to create your own pagination. That being said `Element::find()->all()` will throw an error
  
  > Cannot instantiate abstract class craft\base\Element
  
  Thus you'll have to Query for your elements in your own
  
  ```
  // get all possible element ids
  $sectionId = X;
  $query = (new Query())
      ->select('elements.id')
      ->from('{{%elements}}')
      ->leftJoin('{{%elements_sites}}', 'elements_sites.elementId = elements.id')
      ->leftJoin('{{%entries}}', 'entries.id = elements.id')
      ->where(new OrCondition([
          ['=', 'entries.sectionId', $sectionId], <-- your section Id
          ['is', 'entries.sectionId', null],
      ]))
      ->andWhere(new OrCondition([
          ['=', 'elements.type', \craft\elements\Entry::class],
          ['=', 'elements.type', YourCalenderClassComesHere],
      ]))
      ->andWhere(['elements_sites.siteId' => 1])
      ->limit(10)
      ->offset(0)
      ->column();
  
  // populate entry by Id
  foreach ($query as $elementId){
      $element = Craft::$app->getElements()->getElementById($elementId);
  }
  
  ```
  
  > **Comments:**
  > **username_0**: Wow, thanks username_1. What a complete answer. I've yet to test myself with Craft Plugin work so I'll give writing one a go with this! Assuming you'd recommend this to be implemented in plugin form?  
  > **username_1**: You need to implement it via plugin or module, these are the only ways to access custom php code. There are a few other checks you might want to include. The easiest is to run `Entry::find()->getRawSql()` to see all conditions Craft includes by default  
  > **username_0**: This is great. Thanks for your help. I'll be sure to try and write my first plugin with this then! Cheers again.   
  
  ---
  
  