The Movable Type Knowledge Base

Why Are There $ In Some Tags And Not Others?

Question

I see that in the examples in the documentation, some tags use $ and some don't. What is the difference?

Answer

There are two basic types of Movable Type tags: variable tags and container tags. Movable Type allows you to put $ in variable tags to distinguish them from other HTML tags if you wish, but these are purely optional: the system will still process the tags correctly without the $. You cannot use $ in container tags.

A variable tag is a substitution tag. It is a placeholder for a dynamic piece of information. You can include the optional $ in variable tags and they will still be recognized by the system.

For example, the MTEntryTitle tag is replaced with the title of the entry; so it is a variable tag which can be written as either <MTEntryTitle> or <$MTEntryTitle$>.

A container tag contains what might be called a subtemplate, a chunk of text and some Movable Type tags between two other Movable Type tags: the start of the container and the end of the container. MTEntries is an example of a container tag:

<MTEntries>
<$MTEntryTitle$>
</MTEntries>

Since a container tag has both a start and end tag, if you use $ in these, Movable Type won't be able to recognize the end tag. So you should only use $ in variable tags for this reason.

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.