MT-Ellipsis: A Movable Type Filter

Current version is 1.0.1.0 released on 2005-09-04

Contents

What This Filter Does

This filter is used to trim and add an ellipsis … to a given string published from Movable Type. If the string is less than the given length, the string remains unchanged.

I created this filter because I use a list of recent comments on my main blog index page and I wanted to trim down the entry body to a number of characters and add an ellipsis to the end. For those entries that are less than the desired length, no changes were desired.

Requirements

  • This plugin works with Movable Type version 2.x and 3.x.
  • Perl version 5.8.5 or higher. This is what I use. It may work on lower versions. Let me know if it does and I will lower this.
  • You must have the Perl module, Storable, installed.
  • This plugin will only work in static (not dynamic) templates.

Installation Instructions

  1. Download the latest version of the filter.
  2. Unzip the contents of the file.
  3. Copy the file Ellipsis.pl to your Movable Type “plugins” directory. (If you don’t have a plugins directory, create a plugins directory in the same directory where your mt.cgi file is located. Then upload Ellipsis.pl into the newly created plugins directory.)
  4. Give me some credit. You have many choices. Do one or all! 1) Add a trackback link to this page on your page. 2) Donate so that I continue to enhance this filter.

How To Use The Tags

This plugin will only work in static (not dynamic) templates.

  • ellipsis
    Add this filter to any Movable Type tag as a parameter. The attribute value should be set to the length that you want to trim the string to.

Frequently Asked Questions

  • Q: This plugin (and others) don’t seem to be working on my server. Why?
    A: Internally, Movable Type requires some Perl modules to be installed for plugins to work. Some servers do not have these modules installed by default. Please run mt-check.cgi on your server to find out what you are missing.

Examples

1. In this simple example, we add the ellipsis filter to a comment string to chop the comment body down to seventy characters.

<$MTCommentBody convert_breaks="0" remove_html="1" ellipsis="70"$>

Donate

If you enjoy using this filter and/or would like to see it enhanced, please donate a buck or two…or fifty. I will use the money to buy my wife dinner so she lets me keep working on this stuff for free and does not complain.

License

This software is licensed under the CC-GNU LGPL.

CC-GNU LGPL

Download

Download the current version from the link below. Past versions are not archived.

Version History

1.0.1.0 — 2005-09-04
  • Updated plugin info to take advantage of MT 3.2 enhancements.
1.0.0.1 — 2004-12-10
  • Fixed bug where plugin reported error in MT-Medic.
1.0.0.0 — 2004-05-29
  • Made compatible with Movable Type 3.0.
0.10 — 2004-01-11
  • Works for me.

Contact

For questions, suggestions, bug reports, and anything else related to this filter, please e-mail brandon@fuller.name or leave a comment.

Updated: 2010-08-26 at 07:35 MDT in Hacks
Tags: movabletype
Related Posts with Thumbnails