External Content

As with the basic example but this time with just external content.

Adding/Removing Items

<h2>External One</h2>
{exp:shortlist:item
	is_external="yes"
	unique_attr="attr:src"
	attr:title="External One"
	attr:src="http://somewhereelse.url/one"
	attr:blurb="This is an additional blurb for the item"
	attr:type="user_generated"}
{if in_list}
	<a href="{add_url}">Add Item</a>
{if:else}
	<a href="{remove_url}">Remove Item</a>
{/if}
{/exp:shortlist:item}

… repeat …

Will give you something like this :

<h2>External One</h2>
<a href="http://site.url?ACT=12&p=…">Add Item</a>

<h2>External Two</h2>
<a href="http://site.url?ACT=13&p=…">Remove Item</a>

<h2>External Three</h2>
<a href="http://site.url?ACT=13&p=…">Remove Item</a>

Viewing Items

Viewing items using the :view tag is simple. With external content any attr:.. style attribute passed on the :item/:add tag will be available in this loop.

{exp:shortlist:view}
	{if count==1}
	<h3>Your Shortlist ({total_results} Items)</h2>
	<ul>
	{/if}
	<li>
		{title} (<a href="{remove_url}">Remove</a>)
		Item Source : {attr:src}
		Blurb : {attr:blurb}
	</li>
	{if count==total_results}</ul>{/if}
	{if no_results}Your list is empty{/if}
{/exp:shortlist:view}

Will give you something like this :

<h3>Your Shortlist (2 Items)</h3>
<ul>
<li>
	External Two (<a href="http://site.url?ACT=13&p=…">)Remove</a>
	Item Source : http://somewhereelse.url/two
	Blurb : This is an example blurb
</li>
<li>
	External Three (<a href="http://site.url?ACT=13&p=…">)Remove</a>
	Item Source : http://somewhereelse.url/three
	Blurb : This is another blurb
</li>
</ul>