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

LinkEntryToFile Plugin for Movable Type

Current version: 1.1 (7/12/06)

About the LinkEntryToFile Plugin

LinkEntryToFile is a plugin that modifies the interface of Movable Type. When the plugin is installed, you can specify a file on your server to link to the Entry Body or Extended Entry field. The linked file will be kept in sync with the entry, so that you can edit it in an external editor.

This plugin basically takes MT's handy "Link this template to a file" feature and applies it to entries. When using MT to manage certain types of content, especially content that contains extensive HTML formatting, it's useful to be able to use your favorite text-editing application, with syntax highlighting, Undo, search and replace, etc., without having to repeatedly copy and paste into the MT entry screen.

Requirements

This version of LinkEntryToFile requires Movable Type 3.3.

If you're using MT 3.2, you'll need the BigPAPI plugin, and an older version of LinkEntryToFile, which is available in this archive.

Installation

To install the LinkEntryToFile plugin, upload the file LinkEntryToFile.pl to the plugins directory within your Movable Type directory.

Terms of Use

LinkEntryToFile is available free of charge under a Creative Commons license.

Support

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

Movable Type Screen(s) Affected

  • Create New Entry
  • Edit Entry

What You'll See

When LinkEntryToFile is installed and you edit an entry, if the plugin is enabled for the current weblog, you'll see a field labeled Link Entry Body to a file: below the Entry Body field, and (if your preferences are set to display the Extended Entry) a field labeled Link Extended Entry to a file: below the Extended Entry field.

How It Works

To link an entry's body or Extended text to a file, enter the path and filename in the appropriate "Link to a file" field, then save the entry. This can either be an absolute path to a file on your server, beginning with /, or a path relative to the Local Site Path of the weblog to which the entry belongs.

For security reasons, the filename must have an allowed extension. By default, the following extensions are allowed:

.txt
.text
.html
.htm
.shtml
.ssi

With MT 3.2, you can modify this list for an individual weblog or across the whole system by changing the LinkEntryToFile Settings. With MT 3.1x, you'll have to edit the $allowed_ext string defined at the top of LinkEntryToFile.pl

When you enter a filename and save the entry, what happens depends on whether the file already exists and whether you've entered any text in the field:

  • If the file already exists and you've left the entry text field blank, the contents of the file will be loaded into the field.
  • If the file already exists and there's text in the entry text field, the file will be overwritten with the contents of the field.
  • If the file does not exist, it will be created and filled with the contents of the entry text field.

If the file cannot be read or written, or the filename doesn't have one of the allowed extensions, it should not affect the saving of the entry, but you'll see an error message above the "Link to a file" filename in question.

Once an entry field is linked to a file, whenever the entry is loaded, the plugin will check to see if the file has been modified, and if so, it will load the file's contents into the field. This means you can edit the file however you wish, and the changes will be reflected when you rebuild a page containing the entry.

Settings

You can set options for LinkEntryToFile across all weblogs or for individual weblogs. LinkEntryToFile has the following settings:

  • Enable: (weblog-specific only) Uncheck this box to disable entry linking for a particular weblog.
  • Extensions: This list of filename extensions, separated by a space (and without a period), controls what types of files can be linked to entry fields.

To change the settings globally, click on Plugins on the System Overview screen, or under System Shortcuts on the Main Menu. Find the LinkEntryToFile plugin in the listing and click Show Settings.

To change the settings for a specific weblog, go to that weblog's Settings screen and click the Plugins tab. Find the LinkEntryToFile plugin in the listing and click Show Settings.

Version History

6/28/06 - version 1.1

  • Updated code for MT 3.3

7/22/05 - version 1.01

  • Fixed config template subroutine for a change in MT 3.2b2

7/21/05 - 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.