<p>Turns out... the ID's are wrong. I've listed the shortlist ID's and not the entry ID's. Should use entry.elementId. </p>

<p>Here's the fix:</p>

<pre><code> {% for entry in list.items %}
      {% set favId = entry.elementId %}
      {% set favIds = favIds|merge([favId]) %}
 {% endfor %}
</code></pre>

CC BY-SA 3.0
2016-09-16T22:22:55.793Z
Hi, Thanks, it works!
But how do I use the {{ item.removeActionUrl }}?
Martijn La Feber
CC BY-SA 3.0
2015-03-26T16:24:51.170Z
2015-03-26T16:24:51.170Z
Johannes Lamers
<p>I'm trying to display a list of favorited entries. I have a wishlist with entry id's build with Shortlist. So now I want to display them but it doesn't work. The first part getting the favorited id's works perfect.</p>

<p>Here is my code so far:</p>

<pre><code>        {% set favIds = [] %}

        {# LOOP TRUE FAV IDS AND MAKE ARRAY #}
        {% for list in lists %}
            {% if list.items is empty %}
            &lt;p&gt;No wishlist&lt;/p&gt;
            {% else %}
                {% for entry in list.items %}
                    {% set favId = entry.id %}
                    {% set favIds = favIds|merge([favId]) %}
                {% endfor %}
            {% endif %}
        {% endfor %}

        {# CONVERT favIds array in comma separated list #}
        {% set favIdString = favIds|join(', ') %}

        {% set wishlist = craft.entries.id(favIdString).fixedOrder('true') %}       

        {% for entry in wishlist %}
            {{ entry.title }}
        {% endfor %}
</code></pre>

<p>But nothing shows up. If I output {{ favIdString }} I get a nice list if entry ID's. 9619, 9620, 9621, 9622, 9624, 9625</p>

CC BY-SA 3.0
2015-03-26T16:04:22.117Z
I just did a test locally and it worked fine for me.  Are you sure that `9619, 9620, 9621, 9622, 9624, 9625` are all valid entry IDs? You can check by looking `id` column in the `craft_entries` table.
Brad Bell
CC BY-SA 3.0
2015-03-26T16:06:13.650Z
Also, use `fixedOrder(true)` instead of `fixedOrder('true')`. Yours is working because of PHP loose type-casting, but it's better to be explicit, IMO.
Brad Bell
CC BY-SA 3.0
2015-03-26T16:07:24.160Z
Ah there it is... ID's are wrong. Haha. Ok will try to fix it and get the right ID's.
Johannes Lamers
CC BY-SA 3.0
2015-03-26T16:08:46.487Z
Cool... would you mind adding that as the official answer, please?
Brad Bell
<entries><elementcriteriamodel>
Get entry's from fixed ID array
# Get entry's from fixed ID array

(Asked by: username_0 on 2015-03-26)

I'm trying to display a list of favorited entries. I have a wishlist with entry id's build with Shortlist. So now I want to display them but it doesn't work. The first part getting the favorited id's works perfect.
Here is my code so far:
        {% set favIds = [] %}

        {# LOOP TRUE FAV IDS AND MAKE ARRAY #}
        {% for list in lists %}
            {% if list.items is empty %}
            No wishlist
            {% else %}
                {% for entry in list.items %}
                    {% set favId = entry.id %}
                    {% set favIds = favIds|merge([favId]) %}
                {% endfor %}
            {% endif %}
        {% endfor %}

        {# CONVERT favIds array in comma separated list #}
        {% set favIdString = favIds|join(', ') %}

        {% set wishlist = craft.entries.id(favIdString).fixedOrder('true') %}       

        {% for entry in wishlist %}
            {{ entry.title }}
        {% endfor %}

But nothing shows up. If I output {{ favIdString }} I get a nice list if entry ID's. 9619, 9620, 9621, 9622, 9624, 9625

**Tags:** entries, elementcriteriamodel

> **Comments:**
> **username_1**: I just did a test locally and it worked fine for me.  Are you sure that `9619, 9620, 9621, 9622, 9624, 9625` are all valid entry IDs? You can check by looking `id` column in the `craft_entries` table.  
> **username_1**: Also, use `fixedOrder(true)` instead of `fixedOrder('true')`. Yours is working because of PHP loose type-casting, but it's better to be explicit, IMO.  
> **username_0**: Ah there it is... ID's are wrong. Haha. Ok will try to fix it and get the right ID's.  
> **username_1**: Cool... would you mind adding that as the official answer, please?  

---

## 1 answers

### Answer by username_0 on 2015-03-26. Score: 4 | Accepted answer

Turns out... the ID's are wrong. I've listed the shortlist ID's and not the entry ID's. Should use entry.elementId. 
Here's the fix:
 {% for entry in list.items %}
      {% set favId = entry.elementId %}
      {% set favIds = favIds|merge([favId]) %}
 {% endfor %}

> **Comments:**
> **username_2**: Hi, Thanks, it works! But how do I use the {{ item.removeActionUrl }}?  

---

