Applications

RightFields 1.21

Spam Prevention

TinyTuring 1.02

Template Tags

CheckLinks 1.2

Collect 1.2

Columnize 1.11

Compare 1.1

DateTags 2.3

DaylightOrStandard 1.1

DropCap 1.1

FilterCategories 1.1

FirstNWords 1.3

GetXML 1.1

Glue 1.1

IfModified 1.4

Loop 1.1

TextWrap 1.1



Support staggernation.com's plugin development

DropCap Plugin for Movable Type

Current version: 1.1 (7/12/04)

About the DropCap Plugin

This Movable Type plugin implements a set of template tags for displaying the first letter of a section of text as a "drop cap." A drop cap is a large initial letter of a paragraph that spans more than one line of text. The CSS2 standard lets you create drop caps using the first-letter pseudo-element. However, this will not display properly in older browsers, and it also doesn't allow you to use images for your drop caps. This plugin is designed to let you do drop caps the old-fashioned way, by using an HTML table or image with align="left", which will cause the paragraph to wrap around the drop cap.

The DropCap plugin currently only formats the first letter of the entire piece of text you specify (i.e. your entry body), not the first letter of each paragraph. Future versions might add the option to apply formatting to paragraphs within your text.

Installation

To install the DropCap plugin, upload the file DropCap.pl to the plugins directory within your Movable Type directory. If you do not already have a plugins directory, create one before uploading the file. For more information about Movable Type plugins, see the documentation.

Support

Please use the support forums for all support requests, bug reports, feature requests, questions, and comments regarding this plugin.

MTDropCap

This container tag goes around whatever text you want to format with a drop cap. It finds the first letter of the text, ignoring any initial tags and/or whitespace. It replaces this letter with the contents of MTDropCapFormat, inserting the letter wherever MTDropCapLetter appears.

The following example uses a large font size to create a basic drop cap:

<MTDropCap>
 <!--this is the formatting that will replace the first letter of the text-->
 <MTDropCapFormat>
  <table align="left"><tr valign="bottom"><td>
   <p style="font-size:28pt">
    <!--here's where the letter will go-->
    <$MTDropCapLetter$>
   </p>
  </td></tr></table>
 </MTDropCapFormat>
 <!--whatever's within MTDropCap but outside MTDropCapFormat is the text
 whose first letter will be replaced-->
 <$MTEntryBody$>
</MTDropCap>

Note that the tags do not actually know anything about how drop caps work. They simply replace the first letter of the text with the formatting you specify. It's up to you to choose an appropriate size for the drop cap, give it appropriate spacing, etc.

The tag takes the following attribute:

  • case="upper|lower" (optional)
    By default, the plugin does not change the case of the initial letter; it inserts it into the formatting just as it was originally. To force the letter to be either upper or lower case, use this attribute.

MTDropCapFormat

Within MTDropCap, this container tag delimits the HTML code that will be inserted in place of the first letter. It should contain a MTDropCapLetter at the point where you want the letter to be placed.

MTDropCapLetter

Within MTDropCapFormat, indicates where the initial letter should go.

The following example will create graphical drop caps, using images in the directory letters that are named a.gif through z.gif.

<MTDropCap case="lower">
 <MTDropCapFormat>
  <img align="left" src="/images/letters/<$MTDropCapLetter$>.gif">
 </MTDropCapFormat>
 <$MTEntryBody$>
</MTDropCap>

Version History

7/12/04 - version 1.1

  • Plugin now registers itself with MT 3 interface.
  • Added $VERSION variable and package declaration.
  • All container tags now pass conditions along when building contents, so they'll work outside conditional tags within MTEntries, etc.

11/14/03 - version 1.02

  • Multiple instances of MTDropCapLetter within the same format container are now replaced properly (Steve Rushe)

11/12/02 - version 1.01

  • Fixed \1 in regex that was causing a warning

7/18/02 - version 1.0 released


The End As I Know It: A Novel of Millennial Anxiety, by staggernation.com proprietor Kevin Shay, is now available in paperback.

Please visit kshay.com for more information.