Expressions

Freshness Warning
This article is over 16 years old. It's possible that the information you read below isn't current.

Expressions is a Movable Type (MT) plugin designed to be used by plugin developers. The plugin provides a method that allows plugins to support the use of Movable Type tag expressions in their tag attributes. When a plugin is using Expressions, MT tags like the following are allowed:

<MTFoo bar="[MTEntryBody encode_xml="1"]">

Download

Expressions.zip

Installation

Copy Expressions.pm into a directory called MTPlugins inside your Movable Type extlib directory. If you don’t already have a MTPlugins directory, create it first.

Your installation should look like this:
mtdirectory/extlib/MTPlugins/Expressions.pm

Usage

Unless you are developing plugins, you won’t find this plugin very useful. It doesn’t add any new tags. It doesn’t make your copy of MT do anything interesting. All it does is gives plugin authors an easy way to support tag expressions in their plugins.

If you are a plugin developer, well, that’s a different story. By using this plugin, you’ll find you sleep better at night, no longer get hangovers, and have the sudden urge to send me money by PayPal.

Okay, maybe not.

But you will be able to support tag expressions in your plugins.

To use, all you need to do is hand the plugin your MT object reference (commonly stored in $ctx) and your tag attributes (commonly stored in $args). The plugin will check all your attributes for tag expressions, run them through MT for processing, and hand them back to you, ready for use.

The plugin nesses with your token stash and your stashed builder object, so it’s very important to retreive these before you call this plugin. You can do that like so:

my $tokens = $ctx->stash('tokens');
my $builder = $ctx->stash('builder');
$args = MTPlugins::Expressions::process($ctx, $args);

Example

<MTMyPlugin input="[MTEntryTitle]">

Acknowledgements

This plugin was insired by an idea from Brad Choate. Brad also contributed a patch to MTAmazon that is now part of this plugin as well.

License

Like our other freeware, this plugin is released under the open-source MIT License. In plain English, that means you can do whatever you want with the software, including modifying it, selling it, or eating it, but we’re not responsible for anything that goes wrong. Read the license file included with the downloaded package for the complete license.

Revision History

1.0 - January 8, 2003
Initial release.

Nino
November 21, 2005 9:52 AM

Small adjustment needed... MT versions up till 3.2 weren't bothered by: package MT::Plugin::Arithmetic; MT3.2 is, as it should be package MT::Plugins::Arithmetic;

Al
January 24, 2008 9:12 AM

In MT 3.3, there is no "MTPlugins" folder, but rather a "plugins" folder. Do I need to create an "MTPlugins" folder or can I get away with altering line 17 to: "package MT::plugins::Expressions;"

Your comments:

Text only, no HTML. URLs will automatically be converted to links. Your email address is required, but it will not be displayed on the site.

Name:

Not your company or your SEO link. Comments without a real name will be deleted as spam.

Email: (not displayed)

If you don't feel comfortable giving me your real email address, don't expect me to feel comfortable publishing your comment.

Website (optional):

Follow me on Twitter

Best Of

  • How not to apply for a job Applying for a job isn't that hard, but it does take some minimal effort and common sense.
  • Movie marketing on a budget Mark Cuban's looking for more cost effective ways to market movies.
  • California State Fair The California State Fair lets you buy tickets in advance from their Web site. That's good. But the site is a horror house of usability problems.
  • Customer reference questions. Sample questions to ask customer references when choosing a software vendor.
  • Comment Spam Manifesto Spammers are hereby put on notice. Your comments are not welcome. If the purpose behind your comment is to advertise yourself, your Web site, or a product that you are affiliated with, that comment is spam and will not be tolerated. We will hit you where it hurts by attacking your source of income.
  • More of the best »

Recently Read

Get More

Subscribe | Archives

Recently

Assumptions and project planning (Feb 18)
When your assumptions change, it's reasonable that your project plans and needs change as well. But too many managers are afraid to go back and re-work a plan that they've already agreed to.
Feature voting is harmful to your product (Feb 7)
There's a lot of problems with using feature voting to drive your product.
Encouraging 1:1s from other managers in your organization (Jan 4)
If you’re managing other managers, encourage them to hold their own 1:1s. It’s such an important tool for managing and leading that everyone needs to be holding them.
One on One Meetings - a collection of posts about 1:1s (Jan 2)
A collection of all my writing on 1:1s
Are 1:1s confidential? (Jan 2)
Is the discussion that occurs in a 1:1 confidential, even if no agreed in the meeting to keep it so?
Skip-level 1:1s are your hidden superpower (Jan 1)
Holding 1:1s with peers and with people far below you on the reporting chain will open your eyes up to what’s really going on in your business.
Do you need a 1:1 if you’re regularly communicating with your team? (Dec 28)
You’re simply not having deep meaningful conversation about the process of work in hallway conversations or in your chat apps.
What agenda items should a manager bring to a 1:1? (Dec 23)
At least 80% of a 1:1 agenda should be driven by your report, but if you also to use this time to work on things with them, then you’ll have better meetings.

Subscribe to this site's feed.

Contact

Adam Kalsey

Mobile: 916.600.2497

Email: adam AT kalsey.com

Twitter, etc: akalsey

Resume

PGP Key

©1999-2019 Adam Kalsey.