Skip to content

Instantly share code, notes, and snippets.

@daveaiello
Created January 14, 2014 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daveaiello/8420443 to your computer and use it in GitHub Desktop.
Save daveaiello/8420443 to your computer and use it in GitHub Desktop.
Count and display multiple Entry Assets of the type SoundCloud audio track associated with the current entry. This is Movable Type Markup Language code to be used in conjunction with the SuperAssets For SoundCloud plugin, which extends the Movable Type Asset Manager.
<mt:var name="soundcloud_asset_count" value="0">
<mt:EntryAssets type="soundcloud_track">
<mt:var name="soundcloud_asset_count" op="++" setvar="soundcloud_asset_count">
</mt:EntryAssets>
<mt:Ignore>
<!-- Later in the template... -->
</mt:Ignore>
<mt:Unless name="soundcloud_asset_count" eq="0">
<div class="asset-list">
<mt:If name="soundcloud_asset_count" eq="1">
<mt:EntryAssets type="soundcloud_track">
<a href="http://soundcloud.com/<$mt:AssetProperty property="soundcloud_track_user_permalink"$>/<$mt:AssetProperty property="soundcloud_track_permalink"$>" target="_blank">Listen on SoundCloud</a>
</mt:EntryAssets>
<mt:Else>
<h3>Listen on SoundCloud</h3>
<ul>
<mt:EntryAssets type="soundcloud_track">
<li<mt:If name="__counter__" eq="1"> class="first"</mt:If>><a href="http://soundcloud.com/<$mt:AssetProperty property="soundcloud_track_user_permalink"$>/<$mt:AssetProperty property="soundcloud_track_permalink"$>" target="_blank">Track <$mt:var name="__counter__"$></a></li>
</mt:EntryAssets>
</ul>
</mt:If>
</div>
</mt:Unless>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment