The Movable Type Knowledge Base

Why Did I Get An "Out Of Context" Error?

Question

After making some changes to my template, I rebuilt my site, and Movable Type gave me an error saying I used a tag out of context. What does that mean?

Answer

Most Movable Type tags are context-dependent, meaning that they should only be used in the appropriate context. Context is generally determined by either the surrounding template or the surrounding container tags.

For example, since <MTEntryTitle> depends on reading a particular entry in order to return results, it must be placed inside either an MTEntries container, or used on an Individual Entry Archive page (where the context is always one entry, so an MTEntries container is not required).

Another example is the <MTCommentAuthor> tag. It belongs in an MTComments container so that it will know the specific comment for which to return the author name.

In some limited cases, an "out of context" error could indicate more serious problems in the system (i.e., database corruption).

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.