Search code examples
regexmovabletype

MovableType: Displaying CustomField Images Instead of Links


The default behavior of the image custom field is to display a link to the image. Eg.:

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="/images/judd_jon.jpg">judd_jon-1.jpg</a></span>

Is there a way to output just the location or the name of the image so I could display just the image? Eg.:

<img src="/images/judd_jon.jpg" alt="" />

Solution

  • Simon, the rule here is that the asset context starts from the custom field tag, which in your case is "mt:heroic_image" to which you would add "Asset", like on:

    Adding "Asset" to the tag as in the line above gives it asset context so that you could use any of the movable type assets tags from:

    http://www.movabletype.org/documentation/appendices/tags/template-tag-types.html#assets