PlasticField, A Plugin For Movable Type

Thanks to Jay and Arvind, I’ve finally finished my first plugin, PlasticField. I’d appreciate any feedback on it you may have.

Overview

This plugin gives you a new custom field type (‘Formatted Multi-Line Text Field’) with familiar formatting buttons as well as resizing controls instead of the bare boxes that CustomFields provides by default. Extremely handy if you’re using Movable Type’s Custom Fields extensively as a CMS.

PlasticField

Requirements

PlasticField requires that you have MT4.1 Professional or higher running. (The CustomFields addon pack is required.)

Download PlasticField v.0.1 for MT (.zip/32k, updated 6/3/08)

Cost and Support

This plugin is free and is provided as-is. You can use it, redistribute it and/or modify it. You just can’t start reselling it as-is. If you have a problem and would like to submit a fix, let me know. If you’d like to hire me to install it for you or just make your website look good, drop me a line.

Installation

Simply copy the contents of /plugins/ to your Movable Type plugin directory, and copy the contents of /mt-static/ to your static directory.

Using PlasticField

Look for changes to your Customfields » New Field screen. If you’ve installed it correctly, the field type dropdown on the New Field screen should list “Formatted Multi-Line Text Area” as one of the choices.

Converting Existing Fields

Some people have asked about enabling these formatting controls on existing fields. To do that, you must specify a different field type for the field, and that’s not something you can do from the application yet (I’d really like to address in a future release). If you’re feeling bold and have made a backup recently, you can edit the mt-fields table in your database and change the field-type from ‘textarea’ to ‘formatted_field’ in any of the fields you want converted. Do this at your own risk!

  • posted on 3 June 2008
  • by Jesse

InterAction:

3 June 20081. Jesse Gardner:

Bud Gibson: I'm actually using the fck editor plugin to get rich text editing on my blogs. Will I get rich text editor formatting or fck editor formatting with your plugin? Maybe the more general question is whether your plugin respects editor preferences at all or if it just implements convenient buttons that insert raw html into a plain text field?

That's a good question. I did consider employing a different editor (FCK or the YUI simple editor), but decided that was overkill for the purpose I needed it. There are also the additional complications of the context sensitive javascript controls (i.e. click bold while markdown is selected and you get **THIS**, click bold while Convert Line Breaks is selected and you get <strong>this</strong>) as well as figuring out how to enable different formatting types on a per-field basis.

I wasn't sure if formatting switches should be a plugin configuration setting, another field or just (as you mentioned) inherit the text formatting of the entry body. In the mean time you can use the 'filters' template tag modifier to specify how you want the contents of your field to be handled in your templates. (i.e. <mt:EntryDataIngredients filters="markdown" /> )

16 July 20082. padawan:

Hi Jesse,

very useful plugin indeed, it definitely scratches an itch with CustomFields not offering a rich text editor option with text fields.

I do have one issue, the plugin doesn't seem to honor my normal blog /mt-static/ location, it wants its static files from the /cgi-bin/mt/plugins/PlasticField/images/ folder instead.

Best,
François

16 July 20083. padawan:

Trying to debug this with my limited capabilities (I'm definitely NOT a Perl connoisseur!), it looks like the following code isn't executed:

So the following code in PlasticField.pl:

src="plugins/PlasticField/images/bold.gif"

becomes this in the resulting HTML:

src="plugins/PlasticField/images/bold.gif"

I'm using Movable Type version 4.2rc3-fr with Professional Pack 1.11 (the French commercial beta version).

1 September 20084. hixster:

Any fixes for the image location issue? I having the same problem as Padawan,
Thanks H :-)

21 September 20085. thegreenpages:

I am having the same problem as well. It is looking for the static files images @ /cgi-bin/mt/plugins/PlasticField/images/ folder instead.

16 February 20096. Eric:

I found a quick fix for the image problem by replacing <mt:var name="static_uri"> with <$mt:StaticWebPath$> in the PlasticField.pl file.


YourThoughts?



(Minutia)

  • Author:
    Jesse
  • Published:
    Jun 3, 2008
  • Chapters:

GetUpdated

ElseWhere

Find me on aim Find me on delicious Find me on digg Find me on dopplr Find me on facebook Find me on lastfm Find me on linkedin Find me on livejournal Find me on msn Find me on pownce Find me on skype Find me on technorati Find me on twitter Find me on vox Find me on yahoo Find me on youtube