0

I am trying to show a list of items (as bookmarked). However, the list only displays one item.

{exp:shortlist:view}
    {if count != ""}
    <div class="widget clearfix">
        <h4>My Bookmarked Items ({total_results})</h4>
        <ul>
            <li>{title} (<a href="{remove_url}">Remove</a>)</li>
        </ul>
    </div>
    {/if}
    <p>{if no_results}Your list is empty{/if}</p>
{/exp:shortlist:view}        

There are two items in the list, when seen from the backend. However, only one is getting listed.

1
  • This seems like a cache problem. File Cache (EE2's default). Shortlist misbehaves when cache is on. When cache is off, everything is red roses!
    – Noor M
    Commented Feb 16, 2016 at 8:52

1 Answer 1

0

Try changing:

{if count != ""}

to:

{if count==1}

Hopefully that sorts it out :) - I noticed that your code was a little different to the docs...

3
  • I tried another version. It works. However, an entry doesn't get removed properly. <div class="widget quick-contact-widget clearfix"> <h4>My Bookmarked Jobs</h4> <ul class="iconlist"> {exp:shortlist:view} {if count != ""} <li><i class="icon-ok success bold"></i> {title} (<a href="{exp:shortlist:auto_remove}{remove_url}{/exp:shortlist:auto_remove}">Remove</a>)</li> {/if} {if no_results}<li>Your list is empty</li>{/if} {/exp:shortlist:view} </ul> </div>
    – Noor M
    Commented Feb 16, 2016 at 7:00
  • It removes the item from the control panel, however it is listed in the ul li and also the link at the end shows {remove-url}, which is invalid.
    – Noor M
    Commented Feb 16, 2016 at 8:15
  • Guessing it is a cache issue. Because it shows/gets removed after a while. It's happening when you add an entry or remove an entry.
    – Noor M
    Commented Feb 16, 2016 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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