Skip to content

Displaying CustomField Images Instead of Links

Nick-smallworld edited this page Apr 28, 2011 · 5 revisions

The default loop to display the values of custom fields for entries displays image custom fields as 'View image' links. Using following code snippet, you can replace these links by the real image:

<MTEntryCustomFields>
      <MTCustomFieldValue regex_replace="/span class=.mt-enclosure mt-enclosure-image.+?href(.+?)View image<\/a><\/span>/","img src$1">
</mtentrycustomfields>

A better approach: use the <mt:EntryCustomFieldsAsset> tag

As outlined at Image CustomFields in Movable Type 4.1.

Clone this wiki locally