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.
Shortlist has the following main tags. You'll need these for pretty much every implementation.
{exp:shortlist:item}
{exp:shortlist:view}
{lists}..{/lists}
{exp:shortlist:lists}
New in 2.0{exp:shortlist:add_list}
New in 2.0Also, there's a handful of helper tags. These mostly replicate functionality that exists within the main tags, but as a standalone option. Useful in a pinch.
{exp:shortlist:add}
{exp:shortlist:remove}
{exp:shortlist:auto_add}
New in 3.1{exp:shortlist:auto_remove}
New in 3.1{exp:shortlist:auto_add_list}
New in 2.3{exp:shortlist:clear}
{exp:shortlist:clone_url}
{exp:shortlist:item_count}
{exp:shortlist:clear_all}
New in 2.0{exp:shortlist:remove_list}
New in 2.0{exp:shortlist:remove_all}
New in 2.0{exp:shortlist:edit_list_form}
New in 2.0{exp:shortlist:auto_clear}
Added in 2.2{exp:shortlist:auto_clear_all}
Added in 2.2{exp:shortlist:item_in_list}
Added in 2.3{exp:shortlist:list_count}
Added in 2.4{exp:shortlist:add_form}
Added in 2.5 {exp:shortlist:remove_form}
Added in 2.5{exp:shortlist:add_list_form}
Added in 2.5{exp:shortlist:item_form}
Added in 3.0{exp:shortlist:store_track_item}
Added in 3.4.0{exp:shortlist:stats}
Added in 3.5.0This is the main tag pair for adding for removing items from a user's list. There are two usage options for it - Internal (native EE entries) and External Content.
Internal items require the following parameters :
entry_id
To use with external content the following parameters are available :
is_external
title
or attr:title
unique_attr
attr:..
extra:..
New in 3.0{add_url}
or {list_add_url} tag.Examples for the usage of the :item tag is also available here.
Within the :item tag to following variables are available :
{in_list}
{add_url}
{remove_url}
{clear_url}
{not_in_any_list}
Added in 2.3{entry_real_date}
Added in 3.1{lists}
New in 2.0{list_title}
{list_name}
{list_add_url}
{list_remove_url}
{list_clear_url}
{default_list}
{in_this_list}
{extra:..}
New in 3.0Note: Shortlist will automatically parse out any variables that look like {extra:..} to protect the tag output. The upshot of this is that any variable like '{extra:test}' or '{extra:not_a_real_value}' will return a blank string, if the user hasn't explicitly set a value
The main tag pair for viewing the contents of a user's list. You can use this tag pair without any parameters to simply list a user's default list contents. All of the parameters are optional.
list_id
list_name
Added in 2.4list_url_title
list_url_title_start
list_url_title_end
return
list_orderby
list_sort
list_owner_id
New in 3.3.0Note: The :view tag is really a channel:entries loop in disguise. Most of the parameters available on the channel:entries tag are also available here.
You can use the :view loop as you would a channel:entries loop. If the content you're listing is internal all the normal field and field tags will work here too.
Also available are the following variables :
{list_id}
{list_name}
{list_description}
Added in 2.4{item_id}
{is_external}
{is_internal}
{is_owner}
{in_list}
{add_url}
Note: This is only of use if the list currently being viewed is not owned by this user (ie. {is_owner} is false)
{remove_url}
Note: If the list is owned by the current user this will let them remove it from their list. If the list is owned by a different user (ie. {is_owner} is false) this will allow them to remove it from their own list (assuming they have it in their own list. That can be checked with the {in_list} variable)
{clone_url}
Note: This will return an empty string if the current list is owned by the this user (ie. {is_owner} is true).
{remove_list_url}
New in 2.0{make_default_url}
New in 2.0{clear_list_url}
New in 2.0{is_default}
New in 2.0{attr:..}
{shortlist_unique_val}
These are all in addition to the standard entry variables like {title}
, {entry_id}
, {entry_date}
etc..
The :lists tag is a real workhorse. You can use it to loop over a user's lists and display the contents of those lists.
All the tag params on the tag are optional, but you can some really neat things with them.
list_id
list_name
list_url_title
list_url_title_start
list_url_title_end
orderby
sort
return
{list_title}
{list_description}
Added in 2.4{list_count}
{list_id}
{list_name}
Added in 2.4{list_url_title}
:edit_list_form
. Great for creating simple sharing urls. Pair this with the parameter of the same name to filter down the lists to display later.{list_url_title_start}
list_url_title_end
variable, you can create neater sharing urls that don't require such stringent uniqueness. Checkout the examples on sharing to see their usage.{list_url_title_end}
list_url_title_start
as explained above.{is_default}
{make_default_url}
{remove_list_url}
{clear_list_url}
{items}
If you never plan on allowing users to have multiple lists, you can skip this tag entirely, and Shortlist will behave perfectly well. To find out more about using the :lists tag and working with multiple lists, checkout the examples of working with lists.
The :add_list tag returns a link that will create a new list for the current user. Unless supplied as part of the tag, the list will be created with a default title and set to be the new default list. You can change that using the supplied tag parameters, also all these values are editable by the user after the list is created.
list_title
list_name
Added 2.4make_default
'yes' or 'no'list_url_title
list_url_title_start
list_url_title_end
return
Note: Unless otherwise set, new lists will automatically become the default list for the user. A user can change their default list with the {make_default_url}
variable in the :lists
tag, and can directly add items to a non-default list at any point too.
The :add tag is a quick helper single tag that can be used to create a url to add an item to a user's list, without going into the tag pair as with the :item tag.
Note: The same tags and parameters on the :item tag apply to the :add tag.
In addition, there are four 'remove_from_
' parameters that might come in handy. If specified, this item will be automatically removed from the matching list, in the same action as being added to a different list. You can specify the list to remove from using the 'list_id', 'list_url_title', 'list_url_title_start' and 'list_url_title_end'. The parameters follow a regular naming pattern to match :
remove_from_list_name
Added in 2.4list_name
remove_from_list_id
Added in 2.3list_id
remove_from_list_url_title
Added in 2.3list_url_title
remove_from_list_url_title_start
Added in 2.3list_url_title_start
remove_from_list_url_title_end
Added in 2.3list_url_title_end
You can specify a specific list to add an item to directly with a parameter. Any of the 'list_name', 'list_id', 'list_url_title', 'list_url_title_start' and 'list_url_title_end' values can be used to specify that list.
list_name
Added in 2.4list_name
list_id
Added in 2.3list_id
list_url_title
Added in 2.3list_url_title
list_url_title_start
Added in 2.3list_url_title_start
list_url_title_end
Added in 2.3list_url_title_end
The :remove tag is a quick helper single tag that can be used to create a url to remove an item from a user's list, without going into the tag pair as with the :item tag.
Note: The exact same tags (and requirements) on the :item tag apply to the :remove tag.
Works like the :add tag, but adds the item automatically in the background. This will only add the item if it doesn't already exist in the user's list.
As well as all the standard params available on the :add tag, you can also optionally pass the following :
Note: The exact same tags (and requirements) on the :add tag apply to the :auto_add tag.
Works like the :remove tag, but removes an item automatically adds the item automatically in the background. If the item doesn't exist in the list, nothing will happen.
As well as all the standard params available on the :remove tag, you can also optionally pass the following :
Note: The exact same tags (and requirements) on the :remove tag apply to the :auto_remove tag.
Works like the :add_list tag, but adds the list automatically in the background. Only creates the list if a corresponding list for the user doesn't already exist.
As well as all the standard params available on the :add_list tag, you can also optionally pass the following :
Note: The exact same tags (and requirements) on the :add_list tag apply to the :auto_add_list tag.
The :clear tag is a quick helper that can be used to create a url to totally clear all items from a user's list.
Note: With the addition of multiple lists in 2.0 the clear tag will only clear items from the current default list, or the list for the supplied list_id. If you want to create a 'Clear All' link, use the new :clear_all tag.
list_id
New in 2.0return
Note: The :clear tag works just like the :add or :remove tags and can be called via ajax. In that case it'll return a type value of 'cleared'
The :clear_all tag is a quick helper that can be used to create a url to totally clear all items from all lists a user's lists. If you need to clear items from just a single list, use the :clear tag instead.
return
The :remove_list is a standalone helper to create a url to delete a user's list. This will also remove all the contained items in the list. This is also available within the :lists and :view tags as {remove_list_url}.
list_id
*requiredreturn
The :clear_list is a standalone helper to create a url to clear a user's list. This is also available within the :lists and :view tags as {clear_list_url}.
list_id
*requiredreturn
The :clone_list tag is a quick helper single tag that can be used to create a url to clone a shared list. This is also available within the :view tag as {clone_url}.
list_id
*RequiredThe :item_count tag is a single tag that simply returns the current count of items within a user's list. If no list_id is passed, will return the count for the default list. For example :
list_id
New in 2.0all_lists
New in 2.1You have {exp:shortlist:item_count} items
Will return something similar to :
You have 4 items
There are no parameters for this tag.
Used to create a form to allow user's to edit the basic attributes of their lists. Specifically, they can update the {list_title}
, {list_url_title}
, {list_url_title_start}
and {list_url_title_end}
.
list_id
*requiredform_class
form_id
data:..
eg. data:key="val" Added in 3.5.2{list_title}
{list_description}
Added in 2.4{list_url_title}
{list_url_title_start}
{list_url_title_end}
{make_default_url}
Added in 2.3{clear_list_url}
Added in 2.3{remove_list_url}
Added in 2.3Plus, all the other list variables as available in the main :lists
tag. Note, that only the list_title, list_description and list_url_title are editable via this form.
Automatically clears a user's list as soon as parsed. Basically the same as if a user had visited the link generated using the {exp:shortlist:clear}
tag.
Useful if you need to automatically clear a list contents when a user visits a certain page. Can also optionally redirect the user after clearing. By default this tag will clear the current user's default list unless a 'list_id' param is passed. If you want to clear all lists for a user, use the {exp:shortlist:auto_clear_all}
tag instead.
list_id
return
This tag returns nothing, and can be placed anywhere in your template.
Automatically clears all lists for a user as soon as parsed. Basically the same as if a user had visited the link generated using the {exp:shortlist:clear_all}
tag.
If you want to clear just a specific list for a user, use the {exp:shortlist:auto_clear}
tag instead.
return
This tag returns nothing, and can be placed anywhere in your template.
A useful helper tag to let you test to see if a specific item is in a specific list for the current user. Great if you're using Shortlist with a few automatic lists and want to change the behavior of your templates if an item is in certain lists.
item_id
entry_id
list_id
list_name
list_url_title
list_url_title_start
list_id
Note: Either the item_id or entry_id parameters are required to specify which entry to check. Also, at least one of the list_.. params is required to specify the list to check
This tag return 'yes' if the item is the corresponding list, or 'no' in all other cases (including if the list or item is invalid)
A useful helper tag to quick return the count of lists for the current user. Takes no parameters
A form version of the {exp:shortlist:add} tag. Great if you need to be able to set some values dynamically based on user input. Accepts 'form_class' and 'form_id' parameters to control class/ids on the form. Also you can pass arbitrary data attributes as params liks 'data:key="val"'
Where you'd set the values for the {exp:shortlist:add} tag as parameters, simply add them here as form inputs.
A form version of the {exp:shortlist:remove} tag. Great if you need to be able to set some values dynamically based on user input. Accepts 'form_class' and 'form_id' parameters to control class/ids on the form. Also you can pass arbitrary data attributes as params liks 'data:key="val"'
Where you'd set the values for the {exp:shortlist:remove} tag as parameters, simply add them here as form inputs.
A form version of the {exp:shortlist:add_list} tag. Great if you need to be able to set some values dynamically based on user input. Accepts 'form_class' and 'form_id' parameters to control class/ids on the form. Also you can pass arbitrary data attributes as params liks 'data:key="val"'
Where you'd set the values for the {exp:shortlist:add_list} tag as parameters, simply add them here as form inputs.
A form to let you set any additional content per list item. Simply named your extra details prefixed with 'extra:..'. For example, if you wanted to let your users keep per-item notes, you could have a field called 'extra:notes', or quantities with a field called 'extra:qty'.
The values saved here will be available in the other shortlist tags with the same name, ie. {extra:notes}
or {extra:qty}
etc..
Note: Only the owner of a list item can change these values. Shortlist will reject any attempts to change the values by any one other than the list/item owner.
item_id
optionalform_class
form_id
data:..
eg. data:key="val" Added in 3.5.2return
The :item_form doesn't have any direct variables. It's designed to be used within the :item, :view etc.. tags for variable population.
All that's required is to prefix for your inputs with 'extra:' and Shortlist will do the rest. For example to update a single item with extra data points for 'notes' and 'qty', you'd have a form similar to this :
{exp:shortlist:item entry_id="XX"} {title} {exp:shortlist:item_form item_id="{item_id}"} <input type="text" name="extra:notes" value="{extra:notes}"/> <input type="text" name="extra:qty" value="{extra:qty}"/> <input type="submit" value="Save"/> {/exp:shortlist:item_form} {/exp:shortlist:item}
Which will return similar to :
Example Item <form name="shortlist_form" method="POST" action=".."> <input type="hidden" name="list_id" value="XX"/> <input type="text" name="extra:notes" value="{extra:notes}"/> <input type="text" name="extra:qty" value="{extra:qty}"/> <input type="submit" value="Save"/> </form>
Alternatively you can edit a whole set of items in a single action. Just name the inputs like 'extra:notes[XX]
' where XX is the item_id. For example :
{exp:shortlist:item_form} {exp:shortlist:view} {title} <input type="text" name="extra:notes[{item_id}]" value="Example Notes"/> <input type="text" name="extra:qty[{item_id}]" value="2"/> {/exp:shortlist:view} <input type="submit" value="Save"/> {/exp:shortlist:item_form}
Which will return similar to :
<form name="shortlist_form" method="POST" action=".."> Item One <input type="text" name="extra:notes[1]" value="Example Notes"/> <input type="text" name="extra:qty[1]" value="2"/> Item Two <input type="text" name="extra:notes[2]" value="More notes"/> <input type="text" name="extra:qty[2]" value="1"/> Item Three <input type="text" name="extra:notes[3]" value=""/> <input type="text" name="extra:qty[3]" value="10"/> <input type="submit" value="Save"/> {/exp:shortlist:item_form}
Note: On update any fields that weren't passed will be cleared, so if you only want the user to update partial fields, be use sure to include the other data as hidden inputs.
A special tag to help integrate Shortlist with Expresso Store for using Shortlist as a product wishlist. Add this tag within a your {exp:store:product}
tag pair to enable item tracking in baskets. When the item is added as a product to the user's cart we keep a marker and update the original item to show when it's been purchased.
See full details on using Shortlist with Expresso Store
item_id
requiredNote: Also requires adding 'input:shortlist_track_item="WishlistID"
' to the wrapping store:product tag
{exp:shortlist:view} <h3>Wishlist</h3> {exp:store:product entry\_id="{entry\_id}" input:shortlist\_track\_item="WishlistID"} <h2>{title} - {price}</h2> {exp:shortlist:store\_track\_item item\_id="{item\_id}"} <input type="submit" name="submit" value="Add to Cart"/> {/exp:store:product} {/exp:shortlist:view}
With this in place you'll have two new extra attributes on shortlist items you can test against. {extra:store_purchased}
- a bool value to show if this has been purchased, and {extra:store_order_id}
- the order id if it has been purchased.
See full details on using Shortlist with Expresso Store →
A helper tag to let you pull in aggregated statistics about overall usage of Shortlist on the site. There are no parameters, the following variables are available :
{total_items}
{total_unqiue_items}
{total_lists}
{total_users}
{total_members}
{total_guests}
Usage is very simple, and might look like this :
{exp:shortlist:stats} There are a total of {total_items} items in across {total_lists} lists. {total_users} total people using lists, of which {total_members} are members, and {total_guests} are guests. {total_unique_items} different items have been added to lists. {/exp:shortlist:stats}