Skip to content

Instantly share code, notes, and snippets.

@Hiranyaloka
Created September 7, 2011 07:01
Show Gist options
  • Save Hiranyaloka/1199942 to your computer and use it in GitHub Desktop.
Save Hiranyaloka/1199942 to your computer and use it in GitHub Desktop.
This code should produce a list of assets associated with an entry or page.
<div class="sidebar-documents widget">
<mt:EntryAssets>
<mt:If name="__first__">
<div class="widget-content">
<h3>Document<mt:If name="sidebar_asset_count" gt="1">s</mt:If></h3>
<ul>
</mt:If>
<mt:Var name="sidebar_asset_count" op="++" setvar="sidebar_asset_count">
<li><a href="<$mt:AssetURL$>" title="<mt:If tag="AssetDescription"><$mt:AssetDescription$></mt:If>"><$mt:AssetLabel$> - (<$mt:AssetFileExt$>)</a></li>
<mt:If name="__last__">
</ul>
</div>
</mt:If>
</mt:EntryAssets>
</div>
<!-- end w_sidebar_documents.mtml -->
<div class="sidebar-documents widget">
<mt:EntryAssets>
<mt:If name="__first__">
<div class="widget-content">
<h3>Documents</h3>
<ul>
</mt:If>
<mt:Var name="sidebar_asset_count" op="++" setvar="sidebar_asset_count">
<li><a href="<$mt:AssetURL$>" title="<mt:If tag="AssetDescription"><$mt:AssetDescription$></mt:If>"><$mt:AssetLabel$> - (<$mt:AssetFileExt$>)</a></li>
<mt:If name="__last__">
</ul>
</div>
</mt:If>
</mt:EntryAssets>
</div>
<!-- end w_sidebar_documents.mtml -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment