MTDynamic is a Movable Type plugin that is designed to facilitate the dynamic rendering of Movable Type blogs, using URL parmaters to control the display of entries and comments.

Download (v0.6)

Installation

1. Movable Type ships with a dynamic viewer (mt-view.cgi), which is described as an "experimental feature". To use to the viewer, you must turn "SafeMode" off. To do this, edit your "mt.cfg" file such that it includes the following:

SafeMode 0

There should already be a SafeMode section near the bottom of the cfg file.

2. Download and extract Dynamic.pl to your hard drive.

3. Upload Dynamic.pl to the "plugins" directory in your MT Installation.

Template Tags

MTDynamic creates two new tags, <MTDynamicEntries> and <MTDynamicComments>. These tags can be used in the same manner as MTEntries and MTComments - the tags will work in both static and dynamic views.

To use with the MT dynamic viewer, you need to use a path like:

http://www.yourdomain.com/path_to_mt/mt-view.cgi/1/index.html

where the number is the Blog ID of the blog. Index templates can be accessed using this format.

Now you can use URL paramters in the format of ?argument=value to control the entries that are displayed. Any of the MTEntries arguments can be used*. For example:

mt-view.cgi/1/index.html?lastn=10&category=Links

will display the last 10 entries posted by John.

*Note: to specify an author argument in the URL, you need to use a parameter called "entry_author". This is to avoid conflicts with the comment "author" parameter used with comment submissions.

Update (v0.6): To specify an "offset" argument in the URL, you need to use a paramter called "dyn_offset". This is to avoid conflicts with the "offset" parameter used with "rebuild files" tool.

To access individual entry pages using the dynamic viewer, use a path like:

http://www.yourdomain.com/path_to_mt/mt-view.cgi/1/entry/123

where "1" is the blog ID and "123" is the Entry ID.

MTDynamicComments includes two new arguments: start and show. I found that the "lastn" and "offset" approach can get confusing when listing comments, because usually you want to show them in ascending order. The "start" and "show" simplifies this:

start - the first comment to be displayed (chronologically)

show - the total number of comments to be displayed

Using this logic, ?start=11&show=10 will display comments 11 through 20. This can be useful for displaying blog entries with a lot of comments.

What if an argument is defined in the template AND in an URL parameter? In this case, the URL parameter value will override the value defined in the template. This enables you to create templates that can be used in both static and dynamic formats. For example, your home page might be presented in a static format, but you could provide filtered views of the home page using dynamic paths with parameters.

Examples

Using my Mars Rover Blog as an example, see that the home page contains blog entries and photos by two authors: Spirit and Opportunity. You can use MTDynamic to offer filtered views of the home page (note the path and URL parameters):

Only Spirit's blog entries and photos
Only Opportunity's blog entries and photos


This is my first plugin. I am sure there are bugs, please report any strange behaviour. Any and all comments, feedback, and suggestions are welcome.

MTDynamic is a Movable Type plugin that is designed to facilitate the dynamic rendering of Movable Type blogs, using URL parmaters to control the display of entries and comments.

Download (v0.5)

Installation

1. Movable Type ships with a dynamic viewer (mt-view.cgi), which is described as an "experimental feature". To use to the viewer, you must turn "SafeMode" off. To do this, edit your "mt.cfg" file such that it includes the following:

SafeMode 0

There should already be a SafeMode section near the bottom of the cfg file.

2. Download and extract Dynamic.pl to your hard drive.

3. Upload Dynamic.pl to the "plugins" directory in your MT Installation.

Template Tags

MTDynamic creates two new tags, <MTDynamicEntries> and <MTDynamicComments>. These tags can be used in the same manner as MTEntries and MTComments - the tags will work in both static and dynamic views.

To use with the MT dynamic viewer, you need to use a path like:

http://www.yourdomain.com/path_to_mt/mt-view.cgi/1/index.html

where the number is the Blog ID of the blog. Index templates can be accessed using this format.

Now you can use URL paramters in the format of ?argument=value to control the entries that are displayed. Any of the MTEntries arguments can be used*. For example:

mt-view.cgi/1/index.html?lastn=10&category=Links

will display the last 10 entries posted by John.

*Note: to specify an author argument in the URL, you need to use a parameter called "entry_author". This is to avoid conflicts with the comment "author" parameter used with comment submissions.

To access individual entry pages using the dynamic viewer, use a path like:

http://www.yourdomain.com/path_to_mt/mt-view.cgi/1/entry/123

where "1" is the blog ID and "123" is the Entry ID.

MTDynamicComments includes two new arguments: start and show. I found that the "lastn" and "offset" approach can get confusing when listing comments, because usually you want to show them in ascending order. The "start" and "show" simplifies this:

start - the first comment to be displayed (chronologically)

show - the total number of comments to be displayed

Using this logic, ?start=11&show=10 will display comments 11 through 20. This can be useful for displaying blog entries with a lot of comments.

What if an argument is defined in the template AND in an URL parameter? In this case, the URL parameter value will override the value defined in the template. This enables you to create templates that can be used in both static and dynamic formats. For example, your home page might be presented in a static format, but you could provide filtered views of the home page using dynamic paths with parameters.

Examples

Using my Mars Rover Blog as an example, see that the home page contains blog entries and photos by two authors: Spirit and Opportunity. You can use MTDynamic to offer filtered views of the home page (note the path and URL parameters):

Only Spirit's blog entries and photos
Only Opportunity's blog entries and photos


This is my first plugin. I am sure there are bugs, please report any strange behaviour. Any and all comments, feedback, and suggestions are welcome.