Answers.Body: <p>I would write something like this:</p>
  
  <pre><code>{% set ids = craft.request.param('ids')| split('|') %}
  {% for id in ids %}
      {% set entry = craft.entries.id(id).first() %}
      …
  {% endfor %}
  </code></pre>
  
  <p>Alternatively, to reduce the queries, store all the entries in a variable and then loop through ids and find the right match in this smaller set.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-27T15:34:47.080Z
Answers.Text: Don't you need to add `.first` to `craft.entries` since it returns an object?
Answers.UserDisplayName: Ryan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-27T15:40:54.077Z
Answers.Text: Yes, right, edited.
Answers.UserDisplayName: Alessio Breviglieri
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-27T15:59:53.550Z
Answers.Text: You need a dot before `first()`!
Answers.UserDisplayName: Ryan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-27T21:28:15.297Z
Answers.Text: Hi, this worked like a charm. And yes, please add the the dot before `first()`. Thanks a lot!
Answers.UserDisplayName: outline4
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-27T15:04:27.643Z
Answers.LastActivityDate: 2017-09-28T06:31:39.097Z
Answers.LastEditDate: 2017-09-28T06:31:39.097Z
Answers.UserDisplayName: Alessio Breviglieri
Body: <p>I've set up a print template for furniture labels.<br>
  I let my client print the labels with a special Link like </p>
  
  <pre><code>/label?ids="x|y|z"
  </code></pre>
  
  <p>It all works good. Now he sometimes wants to print the same label multiple times, so he and I tried the following: </p>
  
  <pre><code>/label?ids="x|x|x|y|z|z|z"
  </code></pre>
  
  <p>The underlying code is the following: </p>
  
  <pre><code>{% set ids = craft.request.param('ids')| split('|')|join(',') %}
  {% set params =
      {
          section: 'furniture',
          limit : null,
          id: ids
  
      }
  %}
  {% paginate craft.entries(params) as entries %}
  {% for entry in entries %}
       ...
  {% endfor %}
  </code></pre>
  
  <p>This will only display x and z one time.   </p>
  
  <p>Is there a way around this? </p>
  
  <p>Any help appreciated. </p>
  
Tags: <entries>
Title: How to display an entry id multiple times?
ThreadText: # How to display an entry id multiple times?
  
  (Asked by: username_0 on 2017-09-27)
  
  I've set up a print template for furniture labels.  
  I let my client print the labels with a special Link like
  
  ```
  /label?ids="x|y|z"
  
  ```
  
  It all works good. Now he sometimes wants to print the same label multiple times, so he and I tried the following:
  
  ```
  /label?ids="x|x|x|y|z|z|z"
  
  ```
  
  The underlying code is the following:
  
  ```
  {% set ids = craft.request.param('ids')| split('|')|join(',') %}
  {% set params =
      {
          section: 'furniture',
          limit : null,
          id: ids
  
      }
  %}
  {% paginate craft.entries(params) as entries %}
  {% for entry in entries %}
       ...
  {% endfor %}
  
  ```
  
  This will only display x and z one time.
  
  Is there a way around this?
  
  Any help appreciated.
  
  **Tags:** entries
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-09-27. Score: 3 | Accepted answer
  
  I would write something like this:
  
  ```
  {% set ids = craft.request.param('ids')| split('|') %}
  {% for id in ids %}
      {% set entry = craft.entries.id(id).first() %}
      …
  {% endfor %}
  
  ```
  
  Alternatively, to reduce the queries, store all the entries in a variable and then loop through ids and find the right match in this smaller set.
  
  > **Comments:**
  > **username_2**: Don't you need to add `.first` to `craft.entries` since it returns an object?  
  > **username_1**: Yes, right, edited.  
  > **username_2**: You need a dot before `first()`!  
  > **username_0**: Hi, this worked like a charm. And yes, please add the the dot before `first()`. Thanks a lot!  
  
  ---
  
  