Skip to content

Instantly share code, notes, and snippets.

@kimonostereo
Last active March 31, 2016 19:53
Show Gist options
  • Save kimonostereo/c6c811e3c02215a3116b to your computer and use it in GitHub Desktop.
Save kimonostereo/c6c811e3c02215a3116b to your computer and use it in GitHub Desktop.
This is using Assetylene v2.0.3 from https://github.com/endevver/mt-plugin-assetylene
<mt:Assets>
<mt:Section strip_linefeeds="1" replace=" ","">
<mt:If tag="mt:AssetType" eq="image"><mt:ignore><!-- if the asset type is an image, then... --></mt:ignore>
<mt:ignore><!-- set the variables for alignment and thumbnail size --></mt:ignore>
<mt:AssetyleneAlign setvar="align">
<mt:AssetyleneThumbWidth setvar="thumb_width">
<mt:ignore><!-- div for asset alignment --></mt:ignore>
<div class="asset-image<mt:If name="align" eq="left"> img-left</mt:If><mt:If name="align" eq="right"> img-right</mt:If>">
<mt:ignore><!-- if the image is a thumbnail... --></mt:ignore>
<mt:If tag="AssetyleneThumb">
<p>
<mt:If tag="mt:AssetylenePopup">
<a href="<$mt:AssetURL$>">
</mt:If>
<img class="img-responsive<mt:if tag="mt:AssetyleneAlign" eq="center"> center-block</mt:If>" src="<mt:AssetThumbnailURL width="$thumb_width">" alt="<mt:AssetLabel>" />
<mt:If tag="mt:AssetylenePopup">
</a>
</mt:If>
</p>
<mt:If tag="AssetyleneCaption">
<p style="max-width:<$mt:Var name="thumb_width"$>px;color:teal;" class="<mt:If tag="mt:AssetyleneAlign" eq="center">center-block</mt:If>"><small><em><mt:AssetyleneCaption></em></small></p>
</mt:If>
<mt:ignore><!-- if the image is full size... --></mt:ignore>
<mt:else>
<p>
<mt:If tag="mt:AssetylenePopup">
<a href="<$mt:AssetURL$>">
</mt:If>
<img class="img-responsive<mt:If name="align" eq="center"> center-block</mt:If>" src="<mt:AssetURL>" alt="<mt:AssetLabel>">
<mt:If tag="mt:AssetylenePopup">
</a>
</mt:If>
</p>
<mt:If tag="AssetyleneCaption">
<p style="max-width:<mt:AssetProperty property="image_width">px;color:teal;" class="<mt:If tag="mt:AssetyleneAlign" eq="center">center-block</mt:If>"><small><em><mt:AssetyleneCaption></em></small></p>
</mt:If>
</mt:If><mt:ignore><!-- end assetyleneThumb --></mt:ignore>
</div><mt:ignore><!-- end div asset-image --></mt:ignore>
<mt:else><mt:ignore><!-- if the asset isn't an image do this --></mt:ignore>
<a href="<$mt:AssetURL$>"><$mt:AssetFileName$></a>
</mt:If>
</mt:Section>
</mt:Assets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment