<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">




<channel>
<title>Eat Drink Sleep Movable Type</title>
<link>http://eatdrinksleepmovabletype.com/</link>
<description>Do you Eat, Drink, and Sleep Movable Type?I know I do.</description>
<language>en</language>
<managingEditor>dan@eatdrinksleepmovabletype.com</managingEditor>
<copyright>Copyright 2013</copyright>
<lastBuildDate>Fri, 31 May 2013 11:45:00 -0500</lastBuildDate>
<pubDate>Fri, 31 May 2013 11:45:13 -0500</pubDate>

<generator>http://www.movabletype.org/?v=4.23-en</generator>
<webMaster>dan@eatdrinksleepmovabletype.com</webMaster>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>





<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/EatDrinkSleepMovableType" /><feedburner:info uri="eatdrinksleepmovabletype" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><media:copyright>Copyright 2013</media:copyright><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item>
<title>Poll Position 2.0!</title>
<description>Poll Position 2.0 is here! It brings several exciting new features: Movable Type 5.1+ compatibility Quizzes, in addition to Polls Vote tracking, to see who voted when and for what choice Authenticated and restricted participation options Take a closer look!…</description>
<link>http://feedproxy.google.com/~r/EatDrinkSleepMovableType/~3/H9RAOeiLJY8/</link>
<guid isPermaLink="false">585@http://eatdrinksleepmovabletype.com/</guid>
<content:encoded><![CDATA[Poll Position 2.0 is here! It brings several exciting new features: Movable Type 5.1+ compatibility Quizzes, in addition to Polls Vote tracking, to see who voted when and for what choice Authenticated and restricted participation options Take a closer look!…<p><a href="http://eatdrinksleepmovabletype.com/plugins/poll_position/">Poll Position</a> 2.0 is here! It brings several exciting new features:</p>

<ul>
<li>Movable Type 5.1+ compatibility</li>
<li>Quizzes, in addition to Polls</li>
<li>Vote tracking, to see who voted when and for what choice</li>
<li>Authenticated and restricted participation options</li>
</ul>

<p>Take a <a href="http://eatdrinksleepmovabletype.com/plugins/poll_position/">closer look</a>!</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=H9RAOeiLJY8:vGWGW8x_u78:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=H9RAOeiLJY8:vGWGW8x_u78:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=H9RAOeiLJY8:vGWGW8x_u78:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=H9RAOeiLJY8:vGWGW8x_u78:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=H9RAOeiLJY8:vGWGW8x_u78:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EatDrinkSleepMovableType/~4/H9RAOeiLJY8" height="1" width="1"/>]]></content:encoded>
<pubDate>Fri, 31 May 2013 11:45:00 -0500</pubDate>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sherree and Dan Wolfgang</dc:creator><feedburner:origLink>http://eatdrinksleepmovabletype.com/announcements/poll_position_20/</feedburner:origLink></item>

<item>
<title>Survey: Poll Position 2.0!</title>
<description>Poll Position 2.0 is here! It brings several exciting new features: Movable Type 5.1+ compatibility Quizzes, in addition to Polls Vote tracking, to see who voted when and for what choice Authenticated and restricted participation options Take a closer look!…</description>
<link>http://feedproxy.google.com/~r/EatDrinkSleepMovableType/~3/H9RAOeiLJY8/</link>
<guid isPermaLink="false">585@http://eatdrinksleepmovabletype.com/</guid>
<content:encoded><![CDATA[<p>Another fun survey!</p>
                <p><a href="http://eatdrinksleepmovabletype.com/plugins/poll_position/">Poll Position</a> 2.0 is here! It brings several exciting new features:</p>

<ul>
<li>Movable Type 5.1+ compatibility</li>
<li>Quizzes, in addition to Polls</li>
<li>Vote tracking, to see who voted when and for what choice</li>
<li>Authenticated and restricted participation options</li>
</ul>

<p>Take a <a href="http://eatdrinksleepmovabletype.com/plugins/poll_position/">closer look</a>!</p>

		
			<p>Voting is closed for this survey, but you can still <a href="http://eatdrinksleepmovabletype.com/announcements/poll_position_20/?display_results=1">see the results</a>.</p>
			<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=H9RAOeiLJY8:vGWGW8x_u78:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=H9RAOeiLJY8:vGWGW8x_u78:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=H9RAOeiLJY8:vGWGW8x_u78:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=H9RAOeiLJY8:vGWGW8x_u78:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=H9RAOeiLJY8:vGWGW8x_u78:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EatDrinkSleepMovableType/~4/H9RAOeiLJY8" height="1" width="1"/>]]></content:encoded>
<pubDate>Fri, 31 May 2013 11:45:00 -0500</pubDate>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sherree and Dan Wolfgang</dc:creator><feedburner:origLink>http://eatdrinksleepmovabletype.com/announcements/poll_position_20/</feedburner:origLink></item>

<item>
<title>Upgrading Plugins with Support for Movable Type 4 and 5</title>
<description>A lot of plugins were developed for Movable Type 4. Some of those plugins work with MT5 (such as plugins that add modifiers), however many are incompatible. Upgrading plugins to add support for MT5 is not the most straight-forward thing,…</description>
<link>http://feedproxy.google.com/~r/EatDrinkSleepMovableType/~3/ICpiLkeETQw/</link>
<guid isPermaLink="false">578@http://eatdrinksleepmovabletype.com/</guid>
<content:encoded><![CDATA[A lot of plugins were developed for Movable Type 4. Some of those plugins work with MT5 (such as plugins that add modifiers), however many are incompatible. Upgrading plugins to add support for MT5 is not the most straight-forward thing,…<p>A lot of plugins were developed for Movable Type 4. Some of those plugins work with MT5 (such as plugins that add modifiers), however many are incompatible. Upgrading plugins to add support for MT5 is not the most straight-forward thing, so I&#8217;ve been keeping some notes about my progress; hopefully these tips are helpful to others, too.</p>

<p>The topics covered:</p>

<ul class="toc">
<li><a href="#version-specific-content">Version-specific content</a></li>
<li><a href="#form-elements">Form elements</a></li>
<li><a href="#undefined-subroutine-errors">&#8220;Undefined Subroutine&#8221; Errors</a></li>
<li><a href="#building-menus">Building Menus</a></li>
<li><a href="#listing-framework">Listing Framework</a></li>
<li><a href="#popup-dialogs">Popup dialogs</a></li>
<li><a href="#object-listings-in-popup-dialogs">Object listings in popup dialogs</a></li>
</ul>

<hr />

<h2 id="version-specific-content">Version-Specific Content</h2>

<p>I&#8217;ve found many templates can still use much of the same HTML and MTML between both versions of MT. A simple <code>&lt;mt:If&gt;</code> statement makes it easy to serve a specific piece to each version of MT. In the following example, the MT5 code sends the user to a page built with the Listing Framework while the fallback MT4 link sends them to the traditional <code>app:listing</code> screen.</p>

<pre><code>&lt;mt:If tag="Version" like="/^5/"&gt;
    &lt;a href="&lt;mt:Var name="script_url"&gt;?__mode=list&amp;_type=zencoder_profile"&gt;
&lt;mt:Else&gt;
    &lt;a href="&lt;mt:Var name="script_url"&gt;?__mode=zencoder.profile_list"&gt;
&lt;/mt:If&gt;
</code></pre>

<h2 id="form-elements">Form Elements</h2>

<p>Movable Type versions 4 and 5 use some different class names to format form items. Adding the correct class names for both versions is an easy way to make the form element look correct in both version. For example, a text input in MT4 uses the class &#8220;full-width&#8221; to fill the width of the available screen space; in MT5 the class is &#8220;full&#8221;. The following example uses both class names to display the field properly in each version of Movable Type:</p>

<pre><code>&lt;input id="text-field"
    type="text"
    name="text-field"
    value="&lt;mt:Var name="text_field" escape="html"&gt;"
    class="full full-width" /&gt;
</code></pre>

<p>Textareas use the class &#8220;full-width&#8221; in MT4, and &#8220;text full low&#8221; in MT5:</p>

<pre><code>&lt;textarea id="question"
    name="question"
    rows="3"
    class="text full low full-width"&gt;&lt;mt:Var name="question" escape="html"&gt;&lt;/textarea&gt;
</code></pre>

<p>Movable Type 4 uses <code>&lt;button /&gt;</code> elements for all of the buttons (such as &#8220;Save&#8221; and &#8220;Delete&#8221;). Movable Type 5 only uses <code>&lt;button /&gt;</code> for form actions. Any other type of button (such as for a custom field) must be an <code>&lt;a /&gt;</code> in MT 5. Perhaps coincidentally, MT4 also displays <code>&lt;a /&gt;</code> buttons very nicely with the right classes. MT4 uses the classes &#8220;button&#8221; and &#8220;primary-button&#8221; for formatting; MT5 uses the classes &#8220;action button&#8221; and &#8220;action primary button&#8221; for formatting.</p>

<p>So, the following form action button displays correctly and functions properly in both MT4 and 5:</p>

<pre><code>&lt;button
    mt:mode="pp_save"
    type="submit"
    accesskey="s"
    title="Save this poll."
    class="action primary button primary-button"
    &gt;&lt;__trans phrase="Save Changes"&gt;&lt;/button&gt;
</code></pre>

<p>And the following works as a button that should not trigger a form action (such as for a custom field) in both versions, too:</p>

<pre><code>&lt;a
    onclick="alert('test');"
    class="action button"&gt;
    Choose entry
&lt;/a&gt;
</code></pre>

<h2 id="undefined-subroutine-errors">&#8220;Undefined Subroutine&#8221; Errors</h2>

<p>Some core functions have moved in MT5. If your plugin throws this error, it&#8217;s likely that the function have been moved to another module in MT5.</p>

<h2 id="building-menus">Building Menus</h2>

<p>Menus changed a lot between Movable Type 4 and 5. In MT4 are the Create, Manage, Design, Preferences, Tools, and System Overview menus. In MT5 menus are more focused on objects, with a few other menu types thrown in: Entries, Pages, Assets, Tags, Settings, Tools, Blogs, Websites, Listing Filters, and several more.</p>

<p>In both version of MT, the parent meu must exist in order to add a child item. In other words, a &#8220;Preferences&#8221; menu must exist to add a new menu item called &#8220;My New Preference.&#8221; So, installing the Create and Manage menus to MT5 will add back menu items that a plugin added there; the <a href="http://www.movabletips.com/2010/02/making-some-movable-type-4-plugins-work-on-movable-type-5.html">Create and Manage</a> plugin from <a href="http://www.movabletips.com">Movable Tips</a> makes this easy.</p>

<p>Of course, in both version of Movable Type adding to the menu is simple: a set of registry keys will add an item, and as long as the correct menu is targeted the menu item appears. Both version of Movable Type can be targeted in a single plugin, as in this example, excerpted from <a href="https://github.com/endevver/mt-plugin-imagecropper">ImageCropper</a>:</p>

<pre><code>applications:
    cms:
        menus:
            # MT5 compatibility: add to the Settings menu
            settings:image_cropper:
              label: Thumbnail Prototypes
              mode: list
              args:
                  _type: thumbnail_prototype
              order: 500
              view: blog
            # MT4 compatibility: add to the Preferences menu
            prefs:image_cropper:
              label: Thumbnail Prototypes
              mode: list_prototypes
              order: 500
              view: blog
</code></pre>

<h2 id="listing-framework">Listing Framework</h2>

<p>Using Movable Type 5.1 as a minimum requirement is a good idea because that is when the <a href="http://www.movabletype.org/documentation/author/manage-entries.html">Listing Framework</a> was released. The Listing Framework brings sortable, filterable, customizable listing screens not just to the default Movable Type objects (such as Entries, Assets, and Users) but also to any plugin that wants to levy those features. A great advantage over the old <code>app:listing</code> tag!</p>

<p>In the Menu registry keys above, note that there are some different values for the <code>mode</code> and <code>args</code>. MT4 users still see the traditional listing screen you&#8217;ve already built for your plugin; MT5 users see a listing screen built with the Listing Framework and get to take advantage of all the benefits it offers.</p>

<p>As the <a href="https://github.com/movabletype/Documentation/wiki/En-dev-listing-framework-overview">developer&#8217;s guide for the Listing Framework</a> shows, there are a number of registry keys used to build and control the listing screen.</p>

<p>Adding a listing screen is easy with a few registry keys (excerpted from <a href="http://www.eatdrinksleepmovabletype.com/plugins/poll_position/">Poll Position</a>):</p>

<pre><code>listing_screens:
    pp_questions:
        primary: 'title'
        default_sort_key: 'created_on'
</code></pre>

<p>Next, populate the new screen with <a href="https://github.com/movabletype/Documentation/wiki/En-dev-registry-list-properties"><code>list_properties</code></a>. List properties define the columns of the listing screen and what content is displayed in them, and a number of keys are used to build them as necessary. Honestly, some of the complexities and capabilities of listing properties are still a mystery to me even after referring to how the native MT objects are built, but getting started is quite easy.</p>

<pre><code>list_properties:
    pp_questions:
        id:
            base: '__virtual.id'
            order: 100
        title:
            base: '__virtual.label'
            label: 'Title'
            order: 200
            display: 'default'
        created_by:
            base: '__virtual.author_name'
            order: 600
            display: 'default'
        created_on:
            base: '__virtual.created_on'
            order: 700
            display: 'default'
</code></pre>

<p>Hunting down an appropriate <code>base</code> is integral to getting the column to work correctly. <code>__virtual.string</code> is often a good starting point and specifying the <code>col</code> key (with the column&#8217;s basename) is essential for making a sortable column. Also, when in doubt, try the <code>auto</code> key, which will try to work everything out on its own.</p>

<p>Default filters can be created for your listing screen, too. System filters are poorly documented so referring to examples in the core objects is the best way to learn about them.</p>

<pre><code>system_filters:
    pp_questions:
        polls:
            label: 'Polls'
            order: 100
            items: 
                -
                    type: 'type'
                    args:
                        string: 'poll'
</code></pre>

<p>More complex system filters and list properties (such as those that combine the results from multiple tables) appear to use summary tables, which also are not documented well.</p>

<p>The familiar <a href="https://github.com/movabletype/Documentation/wiki/En-dev-registry-list-actions"><code>list_actions</code></a> are used to add actons to the Listing Framework. These work as they did with MT4, however there are some new capabilities. In particular, I&#8217;ve found the <code>button</code> key to useful.</p>

<p>It&#8217;s worth noting that the Listing Framework does not work in popup dialogs.</p>

<h2 id="popup-dialogs">Popup Dialogs</h2>

<p>Both versions of Movable Type use a popup dialog to help users interact with content &#8212; most notably, perhaps, is the File Upload dialog. The dialog is accessed differently in each version of MT. In MT4, the Javascript functions <code>openDialog()</code> and <code>closeDialog()</code> are used. In MT5, the dialog can be called by simply uses the classes &#8220;mt-open-dialog&#8221; and &#8220;mt-close-dialog&#8221; (in a link, for example), or with a Javascript function.</p>

<p>So, in MT4 you might have used something like this:</p>

<pre><code>&lt;button
    onclick="openDialog(this.form, 'my_mode', blog_id=1...');"
    class="primary-button"&gt;Test the popup dialog&lt;/button&gt;
</code></pre>

<p>In MT5 the same can be done like this:</p>

<pre><code>&lt;a
    class="mt-open-dialog action primary button"
    href="test-page.html"&gt;Test the popup dialog&lt;/a&gt;
</code></pre>

<p>A Javascript function can also be called in MT5:</p>

<pre><code>&lt;a
    onclick="jQuery.fn.mtDialog.open('test-page.html');"
    class="action primary button"&gt;Test the popup dialog&lt;/a&gt;
</code></pre>

<p>Closing a dialog is also easy: create a button that uses the class &#8220;mt-close-dialog&#8221;. If using the Javascript function, call <code>parent.jQuery.fn.mtDialog.close();</code> (note the <code>parent</code> use, because the main page &#8212; not the dialog itself &#8212; must close the dialog).</p>

<h2 id="object-listings-in-popup-dialogs">Object Listings in Popup Dialogs</h2>

<p>As noted above, the Listing Framework&#8217;s capabilities don&#8217;t work in popup dialogs. Object Listings aren&#8217;t used too much in MT4 and I suspect they are used more extensively in <a href="http://www.eatdrinksleepmovabletype.com/plugins/more_custom_fields/">More Custom Fields</a> than they are used in the core. Object Listings in MT4 are something of a specialty item and are constructed from HTML and MTML without the <code>app:listing</code> tag. It&#8217;s no different in MT5, however the table structure has changed, using a separate table for the header/footer and body of the object listing. More Custom Fields&#8217; <code>entry_list.mtml</code> is such a listing and it does work for both MT4 and 5 (object listing, search, and pagination) though it&#8217;s long, complex, and not pretty. If you need to create an object listing, the More Custom Fields <code>entry_list.mtml</code> is probably the best example there is.</p>

<hr />

<p>Hopefully all of these tips from my experience help others get started and successfully wade through the details necessary to add version 5.x compatibility to their MT plugins.</p>

<p><em>This upgrade guide was written by Dan Wolfgang for <a href="http://endevver.com">Endevver</a> after completing some plugin upgrade projects, as a way to document and share some of my experience with the effort required to upgrade plugins.</em></p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=ICpiLkeETQw:pIut1Wy0eiY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=ICpiLkeETQw:pIut1Wy0eiY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=ICpiLkeETQw:pIut1Wy0eiY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=ICpiLkeETQw:pIut1Wy0eiY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=ICpiLkeETQw:pIut1Wy0eiY:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EatDrinkSleepMovableType/~4/ICpiLkeETQw" height="1" width="1"/>]]></content:encoded>
<pubDate>Mon, 04 Mar 2013 14:33:03 -0500</pubDate>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sherree and Dan Wolfgang</dc:creator><feedburner:origLink>http://eatdrinksleepmovabletype.com/discussions/upgrading_plugins_with_support_for_movable_type_4_and_5/</feedburner:origLink></item>

<item>
<title>Survey: Upgrading Plugins with Support for Movable Type 4 and 5</title>
<description>A lot of plugins were developed for Movable Type 4. Some of those plugins work with MT5 (such as plugins that add modifiers), however many are incompatible. Upgrading plugins to add support for MT5 is not the most straight-forward thing,…</description>
<link>http://feedproxy.google.com/~r/EatDrinkSleepMovableType/~3/ICpiLkeETQw/</link>
<guid isPermaLink="false">578@http://eatdrinksleepmovabletype.com/</guid>
<content:encoded><![CDATA[<p>Another fun survey!</p>
                <p>A lot of plugins were developed for Movable Type 4. Some of those plugins work with MT5 (such as plugins that add modifiers), however many are incompatible. Upgrading plugins to add support for MT5 is not the most straight-forward thing, so I&#8217;ve been keeping some notes about my progress; hopefully these tips are helpful to others, too.</p>

<p>The topics covered:</p>

<ul class="toc">
<li><a href="#version-specific-content">Version-specific content</a></li>
<li><a href="#form-elements">Form elements</a></li>
<li><a href="#undefined-subroutine-errors">&#8220;Undefined Subroutine&#8221; Errors</a></li>
<li><a href="#building-menus">Building Menus</a></li>
<li><a href="#listing-framework">Listing Framework</a></li>
<li><a href="#popup-dialogs">Popup dialogs</a></li>
<li><a href="#object-listings-in-popup-dialogs">Object listings in popup dialogs</a></li>
</ul>

<hr />

<h2 id="version-specific-content">Version-Specific Content</h2>

<p>I&#8217;ve found many templates can still use much of the same HTML and MTML between both versions of MT. A simple <code>&lt;mt:If&gt;</code> statement makes it easy to serve a specific piece to each version of MT. In the following example, the MT5 code sends the user to a page built with the Listing Framework while the fallback MT4 link sends them to the traditional <code>app:listing</code> screen.</p>

<pre><code>&lt;mt:If tag="Version" like="/^5/"&gt;
    &lt;a href="&lt;mt:Var name="script_url"&gt;?__mode=list&amp;_type=zencoder_profile"&gt;
&lt;mt:Else&gt;
    &lt;a href="&lt;mt:Var name="script_url"&gt;?__mode=zencoder.profile_list"&gt;
&lt;/mt:If&gt;
</code></pre>

<h2 id="form-elements">Form Elements</h2>

<p>Movable Type versions 4 and 5 use some different class names to format form items. Adding the correct class names for both versions is an easy way to make the form element look correct in both version. For example, a text input in MT4 uses the class &#8220;full-width&#8221; to fill the width of the available screen space; in MT5 the class is &#8220;full&#8221;. The following example uses both class names to display the field properly in each version of Movable Type:</p>

<pre><code>&lt;input id="text-field"
    type="text"
    name="text-field"
    value="&lt;mt:Var name="text_field" escape="html"&gt;"
    class="full full-width" /&gt;
</code></pre>

<p>Textareas use the class &#8220;full-width&#8221; in MT4, and &#8220;text full low&#8221; in MT5:</p>

<pre><code>&lt;textarea id="question"
    name="question"
    rows="3"
    class="text full low full-width"&gt;&lt;mt:Var name="question" escape="html"&gt;&lt;/textarea&gt;
</code></pre>

<p>Movable Type 4 uses <code>&lt;button /&gt;</code> elements for all of the buttons (such as &#8220;Save&#8221; and &#8220;Delete&#8221;). Movable Type 5 only uses <code>&lt;button /&gt;</code> for form actions. Any other type of button (such as for a custom field) must be an <code>&lt;a /&gt;</code> in MT 5. Perhaps coincidentally, MT4 also displays <code>&lt;a /&gt;</code> buttons very nicely with the right classes. MT4 uses the classes &#8220;button&#8221; and &#8220;primary-button&#8221; for formatting; MT5 uses the classes &#8220;action button&#8221; and &#8220;action primary button&#8221; for formatting.</p>

<p>So, the following form action button displays correctly and functions properly in both MT4 and 5:</p>

<pre><code>&lt;button
    mt:mode="pp_save"
    type="submit"
    accesskey="s"
    title="Save this poll."
    class="action primary button primary-button"
    &gt;&lt;__trans phrase="Save Changes"&gt;&lt;/button&gt;
</code></pre>

<p>And the following works as a button that should not trigger a form action (such as for a custom field) in both versions, too:</p>

<pre><code>&lt;a
    onclick="alert('test');"
    class="action button"&gt;
    Choose entry
&lt;/a&gt;
</code></pre>

<h2 id="undefined-subroutine-errors">&#8220;Undefined Subroutine&#8221; Errors</h2>

<p>Some core functions have moved in MT5. If your plugin throws this error, it&#8217;s likely that the function have been moved to another module in MT5.</p>

<h2 id="building-menus">Building Menus</h2>

<p>Menus changed a lot between Movable Type 4 and 5. In MT4 are the Create, Manage, Design, Preferences, Tools, and System Overview menus. In MT5 menus are more focused on objects, with a few other menu types thrown in: Entries, Pages, Assets, Tags, Settings, Tools, Blogs, Websites, Listing Filters, and several more.</p>

<p>In both version of MT, the parent meu must exist in order to add a child item. In other words, a &#8220;Preferences&#8221; menu must exist to add a new menu item called &#8220;My New Preference.&#8221; So, installing the Create and Manage menus to MT5 will add back menu items that a plugin added there; the <a href="http://www.movabletips.com/2010/02/making-some-movable-type-4-plugins-work-on-movable-type-5.html">Create and Manage</a> plugin from <a href="http://www.movabletips.com">Movable Tips</a> makes this easy.</p>

<p>Of course, in both version of Movable Type adding to the menu is simple: a set of registry keys will add an item, and as long as the correct menu is targeted the menu item appears. Both version of Movable Type can be targeted in a single plugin, as in this example, excerpted from <a href="https://github.com/endevver/mt-plugin-imagecropper">ImageCropper</a>:</p>

<pre><code>applications:
    cms:
        menus:
            # MT5 compatibility: add to the Settings menu
            settings:image_cropper:
              label: Thumbnail Prototypes
              mode: list
              args:
                  _type: thumbnail_prototype
              order: 500
              view: blog
            # MT4 compatibility: add to the Preferences menu
            prefs:image_cropper:
              label: Thumbnail Prototypes
              mode: list_prototypes
              order: 500
              view: blog
</code></pre>

<h2 id="listing-framework">Listing Framework</h2>

<p>Using Movable Type 5.1 as a minimum requirement is a good idea because that is when the <a href="http://www.movabletype.org/documentation/author/manage-entries.html">Listing Framework</a> was released. The Listing Framework brings sortable, filterable, customizable listing screens not just to the default Movable Type objects (such as Entries, Assets, and Users) but also to any plugin that wants to levy those features. A great advantage over the old <code>app:listing</code> tag!</p>

<p>In the Menu registry keys above, note that there are some different values for the <code>mode</code> and <code>args</code>. MT4 users still see the traditional listing screen you&#8217;ve already built for your plugin; MT5 users see a listing screen built with the Listing Framework and get to take advantage of all the benefits it offers.</p>

<p>As the <a href="https://github.com/movabletype/Documentation/wiki/En-dev-listing-framework-overview">developer&#8217;s guide for the Listing Framework</a> shows, there are a number of registry keys used to build and control the listing screen.</p>

<p>Adding a listing screen is easy with a few registry keys (excerpted from <a href="http://www.eatdrinksleepmovabletype.com/plugins/poll_position/">Poll Position</a>):</p>

<pre><code>listing_screens:
    pp_questions:
        primary: 'title'
        default_sort_key: 'created_on'
</code></pre>

<p>Next, populate the new screen with <a href="https://github.com/movabletype/Documentation/wiki/En-dev-registry-list-properties"><code>list_properties</code></a>. List properties define the columns of the listing screen and what content is displayed in them, and a number of keys are used to build them as necessary. Honestly, some of the complexities and capabilities of listing properties are still a mystery to me even after referring to how the native MT objects are built, but getting started is quite easy.</p>

<pre><code>list_properties:
    pp_questions:
        id:
            base: '__virtual.id'
            order: 100
        title:
            base: '__virtual.label'
            label: 'Title'
            order: 200
            display: 'default'
        created_by:
            base: '__virtual.author_name'
            order: 600
            display: 'default'
        created_on:
            base: '__virtual.created_on'
            order: 700
            display: 'default'
</code></pre>

<p>Hunting down an appropriate <code>base</code> is integral to getting the column to work correctly. <code>__virtual.string</code> is often a good starting point and specifying the <code>col</code> key (with the column&#8217;s basename) is essential for making a sortable column. Also, when in doubt, try the <code>auto</code> key, which will try to work everything out on its own.</p>

<p>Default filters can be created for your listing screen, too. System filters are poorly documented so referring to examples in the core objects is the best way to learn about them.</p>

<pre><code>system_filters:
    pp_questions:
        polls:
            label: 'Polls'
            order: 100
            items: 
                -
                    type: 'type'
                    args:
                        string: 'poll'
</code></pre>

<p>More complex system filters and list properties (such as those that combine the results from multiple tables) appear to use summary tables, which also are not documented well.</p>

<p>The familiar <a href="https://github.com/movabletype/Documentation/wiki/En-dev-registry-list-actions"><code>list_actions</code></a> are used to add actons to the Listing Framework. These work as they did with MT4, however there are some new capabilities. In particular, I&#8217;ve found the <code>button</code> key to useful.</p>

<p>It&#8217;s worth noting that the Listing Framework does not work in popup dialogs.</p>

<h2 id="popup-dialogs">Popup Dialogs</h2>

<p>Both versions of Movable Type use a popup dialog to help users interact with content &#8212; most notably, perhaps, is the File Upload dialog. The dialog is accessed differently in each version of MT. In MT4, the Javascript functions <code>openDialog()</code> and <code>closeDialog()</code> are used. In MT5, the dialog can be called by simply uses the classes &#8220;mt-open-dialog&#8221; and &#8220;mt-close-dialog&#8221; (in a link, for example), or with a Javascript function.</p>

<p>So, in MT4 you might have used something like this:</p>

<pre><code>&lt;button
    onclick="openDialog(this.form, 'my_mode', blog_id=1...');"
    class="primary-button"&gt;Test the popup dialog&lt;/button&gt;
</code></pre>

<p>In MT5 the same can be done like this:</p>

<pre><code>&lt;a
    class="mt-open-dialog action primary button"
    href="test-page.html"&gt;Test the popup dialog&lt;/a&gt;
</code></pre>

<p>A Javascript function can also be called in MT5:</p>

<pre><code>&lt;a
    onclick="jQuery.fn.mtDialog.open('test-page.html');"
    class="action primary button"&gt;Test the popup dialog&lt;/a&gt;
</code></pre>

<p>Closing a dialog is also easy: create a button that uses the class &#8220;mt-close-dialog&#8221;. If using the Javascript function, call <code>parent.jQuery.fn.mtDialog.close();</code> (note the <code>parent</code> use, because the main page &#8212; not the dialog itself &#8212; must close the dialog).</p>

<h2 id="object-listings-in-popup-dialogs">Object Listings in Popup Dialogs</h2>

<p>As noted above, the Listing Framework&#8217;s capabilities don&#8217;t work in popup dialogs. Object Listings aren&#8217;t used too much in MT4 and I suspect they are used more extensively in <a href="http://www.eatdrinksleepmovabletype.com/plugins/more_custom_fields/">More Custom Fields</a> than they are used in the core. Object Listings in MT4 are something of a specialty item and are constructed from HTML and MTML without the <code>app:listing</code> tag. It&#8217;s no different in MT5, however the table structure has changed, using a separate table for the header/footer and body of the object listing. More Custom Fields&#8217; <code>entry_list.mtml</code> is such a listing and it does work for both MT4 and 5 (object listing, search, and pagination) though it&#8217;s long, complex, and not pretty. If you need to create an object listing, the More Custom Fields <code>entry_list.mtml</code> is probably the best example there is.</p>

<hr />

<p>Hopefully all of these tips from my experience help others get started and successfully wade through the details necessary to add version 5.x compatibility to their MT plugins.</p>

<p><em>This upgrade guide was written by Dan Wolfgang for <a href="http://endevver.com">Endevver</a> after completing some plugin upgrade projects, as a way to document and share some of my experience with the effort required to upgrade plugins.</em></p>

		
			<p>Voting is closed for this survey, but you can still <a href="http://eatdrinksleepmovabletype.com/discussions/upgrading_plugins_with_support_for_movable_type_4_and_5/?display_results=1">see the results</a>.</p>
			<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=ICpiLkeETQw:pIut1Wy0eiY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=ICpiLkeETQw:pIut1Wy0eiY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=ICpiLkeETQw:pIut1Wy0eiY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=ICpiLkeETQw:pIut1Wy0eiY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=ICpiLkeETQw:pIut1Wy0eiY:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EatDrinkSleepMovableType/~4/ICpiLkeETQw" height="1" width="1"/>]]></content:encoded>
<pubDate>Mon, 04 Mar 2013 14:33:03 -0500</pubDate>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sherree and Dan Wolfgang</dc:creator><feedburner:origLink>http://eatdrinksleepmovabletype.com/discussions/upgrading_plugins_with_support_for_movable_type_4_and_5/</feedburner:origLink></item>

<item>
<title>Hot Date Updated for MT5</title>
<description>I made an update to the Hot Date plugin yesterday, adding support for Movable Type 5 (in addition to MT4 support). Not familiar with Hot Date? This plugin will update the Publish Date field to provide drop-down select options to…</description>
<link>http://feedproxy.google.com/~r/EatDrinkSleepMovableType/~3/140nhbv1Kkw/</link>
<guid isPermaLink="false">577@http://eatdrinksleepmovabletype.com/</guid>
<content:encoded><![CDATA[I made an update to the Hot Date plugin yesterday, adding support for Movable Type 5 (in addition to MT4 support). Not familiar with Hot Date? This plugin will update the Publish Date field to provide drop-down select options to…<p>I made an update to the <a href="http://eatdrinksleepmovabletype.com/plugins/hot_date/"><em>Hot Date</em></a> plugin yesterday, adding support for Movable Type 5 (in addition to MT4 support). Not familiar with <em>Hot Date</em>? This plugin will update the Publish Date field to provide drop-down select options to edit the time of your Page or Entry. This is particularly useful if you schedule when an Entry publishes!</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=140nhbv1Kkw:v-3ioyhRp-o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=140nhbv1Kkw:v-3ioyhRp-o:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=140nhbv1Kkw:v-3ioyhRp-o:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?a=140nhbv1Kkw:v-3ioyhRp-o:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/EatDrinkSleepMovableType?i=140nhbv1Kkw:v-3ioyhRp-o:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EatDrinkSleepMovableType/~4/140nhbv1Kkw" height="1" width="1"/>]]></content:encoded>
<pubDate>Tue, 19 Feb 2013 16:25:00 -0500</pubDate>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sherree and Dan Wolfgang</dc:creator><feedburner:origLink>http://eatdrinksleepmovabletype.com/announcements/hot_date_updated_for_mt5/</feedburner:origLink></item>


<media:credit role="author">Sherree and Dan Wolfgang</media:credit><media:rating>nonadult</media:rating></channel>
</rss>
