The Movable Type Knowledge Base

Custom Fields for Entries

Question

How can I include custom data with my entries?

Answer

The fields provided with Movable Type are (with some exceptions noted below), just simple data fields with corresponding template tags for output of stored data. That is to say that Movable Type doesn't demand that you use the fields for their labelled purposes or even use them at all.

For example, let's say you are publishing a very basic photo blog which has the following data:

  • Photo title
  • Photo album title
  • Photo description or caption
  • URL of the uploaded photo for display

Assuming that's all the data you want to store, you can use the following model:

  • Title = Photo title
  • Category = Photo album title
  • Entry body = Photo description or caption
  • Extended entry = URL of the uploaded photo for display

Then, to display this data, you might do the following in your individual archive template:

<h1><$MTEntryTitle$></h1>
<h2>
    Album: 
    <a href="<$MTEntryLink archive_type="Category"$>"><$MTEntryCategory$></a>
</h2>
<p id="photo">
    <img src="<$MTEntryMore$>" alt="Image" />
</p>
<p id="description">
    <$MTEntryBody$>
</p>
<p id="byline">
    by <a href="<$MTEntryAuthorLink$>"><$MTEntryAuthorDisplayName$></a>
</p>

Of course, if you need more fields than Movable Type provides or you want non-free-form fields (e.g. dropdowns or radio button selection), there are two plugins that can provide this functionality: RightFields and CustomFields.

The special Entry Excerpt field

While nearly all entry fields can be used for other purposes and your templates can be edited to display the data appropriately, the entry excerpt field is a notable exception in that it is used semantically by the system in a number of places within the application to provide a summary for your entry.

These include:

  • The output of the following template tags:
    • MTEntryExcerpt, which is used in:
      • The default search templates
      • The default Atom feed
    • MTCCLicenseRDF
    • MTGoogleSearch
    • MTGoogleSearchResult
  • The summary for sent TrackBack pings
  • The summary of new entry notifications (with "include excerpt" option selected)
  • The summary for individual entry TrackBack RSS feed items
  • The summary shown by XML-RPC clients in both the list of recent posts and individual entries
  • The excerpt for each entry in an entry export

While you can certainly avoid using the template tags listed in the first item, use of your entry's excerpt in the last five items above is unavoidable without modifications to the source code.

Related topics:

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or questions. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Yahoo! Small Business web hosting services

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.