Our EE Addons have Moved!
Our ExpressionEngine Add-ons have been acquired by EE Harbor. Head over there for documentation, info and support.
Our ExpressionEngine Add-ons have been acquired by EE Harbor. Head over there for documentation, info and support.
Don't get limited to a single list with Shortlist. With a few extra simple tags, you'll have multi-list support up and running.
To give your users a way to add extra lists, you'll need to use the {exp:shortlist:add_list}
tag. That returns a url to create a new list for this user. Unless you pass a param of make_default='no'
on this tag, the new list will become the default list for the user.
<a href="{exp:shortlist:add_list}">+ New List</a>
Will return something like this:
<a href="http://site.url/?ACT=##&..">+ New List</a>
Once a user has lists, you need a way to show both the lists and their contents. That's really simple, using the {exp:shortlist:lists}
tag. It works exactly as you'd imagine, and simply loops over all the current lists for a user. Within those loops is also a sub-loop {items}..{/items}
which contains all the actual list items for that list.
{exp:shortlist:lists} <h5>{list_title}</h5> <ul> {items} <li><a href="{remove_url}">x</a> {title}</li> {/items} </ul> {if no_results}You have no lists right now{/if} {/exp:shortlist:lists}
Will return something like this:
<h5>Cheese List</h5> <ul> <li><a href="http://site.url/...">x</a> Brie</li> <li><a href="http://site.url/...">x</a> Cheddar</li> <li><a href="http://site.url/...">x</a> Stinking Bishop</li> </ul> <h5>Wine List</h5> <ul> <li><a href="http://site.url/...">x</a> Red</li> <li><a href="http://site.url/...">x</a> White</li> <li><a href="http://site.url/...">x</a> Pink</li> </ul>
It's all really simple. For full details of the tags available, check out the full tag documentation.