<mt:EntryCustomFields>
This container tag iterates, or loops, over all custom fields associated with an entry.
<mt:Entries>
<mt:EntryCustomFields>
<$mt:CustomFieldName$>
</mt:EntryCustomFields>
</mt:Entries>
Filter the list of fields using the include or exclude attributes.
Attributes ¶
include ¶
Value is the name of the custom fields you wish to include from the loop:
<mt:EntryCustomFields include="Foo Field, Bar Field">
<$mt:CustomFieldName$>
</mt:EntryCustomFields>
exclude ¶
Value is the name of the custom fields you wish to exclude from the loop:
<mt:EntryCustomFields exclude="Foo Field, Bar Field">
<$mt:CustomFieldName$>
</mt:EntryCustomFields>
Examples ¶
Display Custom Field Data ¶
The following mtml code will loop through every custom field and output the function tags: mt:CustomFieldName, mt:CustomFieldDescription, mt:CustomFieldValue (using the "default" to apply "[no value]" as a default value), mt:CustomFieldBasename, mt:CustomFieldHTML (attributes encodehtml and strip added to encode html attribtutes and place output on one line, respectivly. Remove these attributes when actual html form elements are desired)...
<mt:Entries>
<h1><$mt:EntryTitle$></h1>
<pre>
<mt:EntryCustomFields>
CustomFieldName: <$mt:CustomFieldName$>
CustomFieldDescription: <$mt:CustomFieldDescription$>
CustomFieldValue: <$mt:CustomFieldValue _default="[no value]"$>
CustomFieldBasename: <$mt:CustomFieldBasename$>
CustomFieldHTML: <$mt:CustomFieldHTML encode_html="1" strip=" "$>
</mt:EntryCustomFields>
</pre>
</mt:Entries>
The following tags are more specific aliases of the more generic tags in the above example:
Leave a note
Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.