1

i was wondering if it was possible to output the same entry multiple times using the entry_id parameters on the channel:entries loop.

Example:

{exp:channel:entries entry_id="14|14|14"}

I need this function to work with Shortlist module from Squarebits to manage a simple cart.

Someone had the same problem before?

2

Not in that fashion, but if you stashed the item (using the Stash add-on) you could grab it a bunch of times without having to repeat the entries loop.

0

I'm the developer of Shortlist

Short answer : No.

Longer : Yes, but it takes extra work

Outputting repeated entries in the same loop is possible at the template parsing level, but is explicitly prevented by the channel:entries template parsing method.

The specific part at which channel->entries() does it's duplicate checking and removal in the build_sql_query() method, around line 2717 (in 2.9.2). That is their safety catch to stop repeats.

If you needed to do your own thing, you can, but you'll need to do a lot of leg work to get around it. To do that you'll need to load up a Parser instance yourself and pass it the entry data directly.

Note - Prior to 2.7.x this was simpler, and Shortlist did have an implementation that worked around things, but with the abstracted parser there's a lot of extra leg work to get it working.

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.