1

I am passing a pipe-delimited list of entry ids into a standard channel entries tag:

{exp:channel:entries 
    entry_id="149|453|321|149"
    dynamic="no"
    limit="4"}

        {title}

{/exp:channel:entries}

I only get 3 results returned, with the second 149 ignored. There seems to be some filter stripping it out. I have gone through the docs but I have not found any parameter along the lines of allow_duplicates="".

How can I make the channel entries tag return the same entry twice if I explicitly request it by entry id?

  • 1
    You could always use more than one channel:entries loop right? – Benek Lisefski Feb 11 '13 at 21:27
2

You can't. The channel:entries tag will always return unique/distinct entries. No way around it.

| improve this answer | |
0

A more advanced approach, but your best bet might be to use Stash - stash that entry in your logic template, then use it more than once if needed in the wrapper template. Since you're trying to return a duplicate entry, you may need to also stash the entry ID or something so you can use it in your wrapper template to target it distinctly. For a primer on template partials using Stash, have a look at Adrienne Travis' article on eeinsider.

| improve this answer | |
0

You could loop through the values you're using to create the pipe-delimited list and call exp:channel:entries for each hit.

I tried getting all rows in SQL, so you could use exp:query and pass each entry_id into an embed, but SQL only returns the distinct rows as well, seemingly no matter what you throw at it.

Select entry_id from exp_channel_titles t where entry_id in (1, 2, 3, 1)

If you do pull each entry individually in a loop, consider making it a plugin or using exp:query to optimize things.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.