<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Learning MT4</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/" />
    <link rel="self" type="application/atom+xml" href="http://learningmt4.com/atom.xml" />
    <id>tag:learningmt4.com,2008-09-17://1</id>
    <updated>2009-01-25T08:04:44Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.21-en</generator>

<entry>
    <title>How to get rid of Monthly Archive listings</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2009/01/how-to-get-rid-of-monthly-archive-listings.php" />
    <id>tag:learningmt4.com,2009://1.200</id>

    <published>2009-01-25T07:46:07Z</published>
    <updated>2009-01-25T08:04:44Z</updated>

    <summary>A default MT4 blog comes with a list of Monthly Archives in the sidebar.  For many blog purposes (LMT an example) you don&apos;t really need to show archives by month. A category listing will suffice.Here are the steps to get...</summary>
    <author>
        <name>Elise</name>
        <uri>http://elise.com</uri>
    </author>
    
        <category term="Beginner Tips" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Templates" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="archivemapping" label="Archive Mapping" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="monthlyarchives" label="Monthly Archives" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[A default MT4 blog comes with a list of Monthly Archives in the sidebar.  For many blog purposes (LMT an example) you don't really need to show archives by month. A category listing will suffice.<div><br /></div><div>Here are the steps to get rid of the monthly archives and to remove them from your sidebar.</div><div><br /></div><div>1.  From your main blog edit window, click on "Design" in the top horizontal navigation bar.  Then click on "Templates".  Scroll down to "Archive Templates" and click on "Monthly Entry Listing".</div><div><br /></div><div>2. Scroll down and click on "Template Options". Where it says "Archive Mapping", see "Monthly" under Type, click on the little trash can icon to the right of it to delete this archive mapping.  Click "Save &amp; Publish".</div><div><br /></div><div>3. Then repeat this on the other archive templates such as Category Listing and Entry.</div><div><br /></div><div>Rebuild your site.</div><div><br /></div><div><span class="Apple-style-span" style="font-weight: bold;">Links</span>:</div><div><a href="http://www.movabletype.org/documentation/administrator/publishing/archive-mapping.html">MT Documentation: Archive Mapping</a></div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Customizing Registration and Profiles with Custom Fields</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/09/customizing-registration-and-profiles-with-custom-fields.php" />
    <id>tag:learningmt4.com,2008://1.2</id>

    <published>2008-09-17T07:02:51Z</published>
    <updated>2008-09-17T07:21:47Z</updated>

    <summary><![CDATA[1.  Create Custom FieldsIn System Overview, select Preferences > Custom FieldsSelect +New Field2.  Edit Registration FormGo to System Overview > Design > Templates > Registration FormAdd this code:&lt;mt:loop name="field_loop">&lt;mt:if name="__first__">&lt;input type="hidden" name="customfield_beacon" value="1" id="customfield_beacon" />&lt;/mt:if>&lt;!-- start-customfield_&lt;mt:var name="basename"> -->&lt;mtapp:settingid="$field_id"label="$name"hint="$description"shown="$show_field"show_hint="$show_hint"required="$required">&lt;mt:var name="field_html">&lt;/mtapp:setting>&lt;!-- end-customfield_&lt;mt:var...]]></summary>
    <author>
        <name>Elise</name>
        <uri>http://elise.com</uri>
    </author>
    
        <category term="Custom Fields" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Profiles" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Registration" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[1.  Create Custom Fields<div><br /></div><div>In System Overview, select Preferences > Custom Fields</div><div><br /></div><div>Select +New Field</div><div><br /></div><div>2.  Edit Registration Form</div><div><br /></div><div>Go to System Overview > Design > Templates > Registration Form</div><div><br /></div><div>Add this code:</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(119, 119, 119); font-family: 'Courier New'; font-size: 12px; ">&lt;mt:loop name="field_loop"><br />&lt;mt:if name="__first__"><br />&lt;input type="hidden" name="customfield_beacon" value="1" id="customfield_beacon" /><br />&lt;/mt:if><br />&lt;!-- start-customfield_&lt;mt:var name="basename"> --><br />&lt;mtapp:setting<br />id="$field_id"<br />label="$name"<br />hint="$description"<br />shown="$show_field"<br />show_hint="$show_hint"<br />required="$required"><br />&lt;mt:var name="field_html"><br />&lt;/mtapp:setting><br />&lt;!-- end-customfield_&lt;mt:var name="basename"> --><br />&lt;/mt:loop></span></div><div><br /></div><div>Then select Save.</div><div><br /></div><div>3.  Edit Profile Form</div><div><br /></div><div>Go to System Overview > Design > Templates > Profile Edit Form</div><div><br /></div><div>Add the same code as above.</div><div><br /></div><div>4.  If you only want to display one custom field in certain area on a form, and not all of them in a row, then use If statements.  Here's an example if the custom field you want to use is named "Website Name" with a basename of "website_name".</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(119, 119, 119); font-family: 'Courier New'; font-size: 12px; ">&lt;mt:if name="field_id" eq="customfield_website_name"><br />&lt;/mt:if></span></div><div><br /></div><div>Your custom field's basename, preceded by "custom field".</div><div><br /></div><div>Example:</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(119, 119, 119); font-family: 'Courier New'; font-size: 12px; ">&lt;mt:loop name="field_loop"><br />&lt;mt:if name="__first__"><br />&lt;input type="hidden" name="customfield_beacon" value="1" id="customfield_beacon" /><br />&lt;/mt:if><br />&lt;!-- start-customfield_&lt;mt:var name="basename"> --><br />&lt;mt:if name="field_id" eq="customfield_website_name"><br />&lt;mtapp:setting<br />id="$field_id"<br />label="$name"<br />hint="$description"<br />shown="$show_field"<br />show_hint="$show_hint"<br />required="$required"><br />&lt;mt:var name="field_html"><br />&lt;/mtapp:setting><br />&lt;/mt:if><br />&lt;!-- end-customfield_&lt;mt:var name="basename"> --><br />&lt;/mt:loop></span></div><div><br /></div><div>Thanks to <a href="http://aaronvanderzwan.com/blog/2008/08/movable-type-42-custom-fields-on-registration-sign-up-form">Aaron Vanderzwan</a> for this last tip.</div><div><br /></div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Create a Custom Feed Reader with Blogger Blog List</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/06/create-a-custom-feed-reader-with-blogger-blog-list.php" />
    <id>tag:learningmt4.com,2008://1.199</id>

    <published>2008-06-27T22:54:10Z</published>
    <updated>2011-06-13T06:03:15Z</updated>

    <summary>Have you ever wanted an easy way of showing a simple feed of your favorite sites within your blog? Blogger has a cool new feature called Blog List for Blogger blogs, and even if you are using Movable Type, or...</summary>
    <author>
        <name>Elise</name>
        <uri>http://elise.com</uri>
    </author>
    
        <category term="Feeds" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="General Tips and Tricks" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="feeds" label="Feeds" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>Have you ever wanted an easy way of showing a simple feed of your favorite sites within your blog?  Blogger has a cool new feature called <a href="http://buzz.blogger.com/2008/06/show-off-your-favorite-blogs-with-blog.html">Blog List</a> for Blogger blogs, and even if you are using Movable Type, or another blogging platform, you can make use of this Blogger feature to pull feeds into your blog.</p>

<p>Here's what it looks like on my site - Simply Recipes: <a href="http://www.elise.com/recipes/food-blogs/foodblogupdates.php">Food Blog Updates</a>:</p>

<p><a href="http://www.learningmt4.com/images/updates-screen-shot1.php" onclick="window.open('http://www.learningmt4.com/images/updates-screen-shot1.php', 'popup', 'width=792,height=610,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0' ); return false"><a href="http://www.learningmt4.com/images/updates-screen-shot.jpg"><img src="http://www.learningmt4.com/images/updates-screen-shot-thumb-400x308.jpg" width="400" height="308" alt="updates-screen-shot.jpg"/></a></a></p>

<p>Which is driven off of this Blogspot page:  <a href="http://foodbloglinks.blogspot.com/">http://foodbloglinks.blogspot.com/</a>.</p>

<p>It's very easy to set up.  Here are the steps in detail:</p>]]>
        <![CDATA[<p><b>1.  Create a Blogger Blog</b>. If you don't already have a Blogger account, get one for free at <a href="http://blogger.com">http://blogger.com</a>.  Give your new blog a blog title that you want as the title of your feed section, like "Updates from Favorite Blogs".  Give the blog address anything you want.  Choose the default "Minima" template.  It will be the easiest with which to work.  When you've created your new blog, click on "Layout".</p>

<p><b>2.  Add blogs to your Blog List.</b> Click on "Add a Page Element" in the right sidebar layout section.  Then look for the Blog List element, and click "Add to Blog".  Delete whatever is written in the title field of the popup.  Click on "Add to List" and start adding the blogs whose feeds you want on your list, one by one.  Select if you want to see the blogs' icons, the titles of the most recent items, snippets of most recent items, and the date of the last update.  If you want you can rename the feed titles (sometimes they're a little long). Then click on "SAVE".</p>

<p><a href="http://www.learningmt4.com/images/config-blog-list.php" onclick="window.open('http://www.learningmt4.com/images/config-blog-list.php', 'popup', 'width=545,height=569,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0' ); return false"><img src="http://www.learningmt4.com/images/config-blog-list-thumb-400x417.jpg" width="400" height="417" alt="config-blog-list.jpg"/></a></p>

<p><b>3.  Strip the Blogger blog layout of everything that isn't necessary.</b> Return to the Layout edit.  Delete all of the sidebar elements except for "Blog List".  To do that, click on "edit" for each page element, and click on "Remove" in the popup.</p>

<p>Click on "Edit HTML".  Scroll down to #main-wrapper and change the width to 0.  Change the #sidebar-wrapper width to however wide you want the feed text to be.  In my case, I changed it to 600.  Change the widths of the #outer-wrapper, #header-wrapper, and #footer to whatever your sidebar width is. </p>

<p>Remove the Blogger nav bar by adding the following code to the CSS (in the footer section): <pre><code>#navbar {<br />
   display: none;<br />
   }</code></pre></p>

<p>Click "SAVE TEMPLATE".  Now click on "Page Elements".  It should look like this: </p>

<p><a href="http://www.learningmt4.com/images/page-elements-2.php" onclick="window.open('http://www.learningmt4.com/images/page-elements-2.php', 'popup', 'width=810,height=558,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0' ); return false"><img src="http://www.learningmt4.com/images/page-elements-2-thumb-400x275.jpg" width="400" height="275" alt="page-elements-2.jpg"/></a></p>

<p>If you click on "View Blog" you should see something like this:</p>

<p><a href="http://www.learningmt4.com/images/favorite-blogs-example.php" onclick="window.open('http://www.learningmt4.com/images/favorite-blogs-example.php', 'popup', 'width=612,height=695,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0' ); return false"><img src="http://www.learningmt4.com/images/favorite-blogs-example-thumb-300x340.jpg" width="300" height="340" alt="favorite-blogs-example.jpg"/></a></p>

<p>You will probably want to change the header text into something that better suits your blog's style.   To get rid of the borders, click on "Edit HTML" and scroll down to #header-wrapper and #header.  Change the border from 1px to 0px.  Add header font color, size and type information to #header.  Click SAVE TEMPLATE and view the blog. </p>

<p>For example, </p>

<pre><code>
#header h1 {
  margin:0px 0px 0;
  padding:15px 0px .25em;
  line-height:1.2em;
  text-align: left;
  color: #333;
  font: 20px Georgia, "Times New Roman", Times, serif;
  padding: 15px 0 0 0;
  padding-bottom: 1px;
  clear:both;
}
</code></pre>

<p>You can also change the default text colors and styles in the variable name section at the top of the Edit HTML template.</p>

<p>Review your published blog and take note of the URL.</p>

<p><b>4.  Use an iframe tag to pull the Blogger blog into your regular blog.</b>  Open up your Movable Type (or other platform) blog edit.  In Movable Type, create a new index template or page.  If using an index template, copy over whatever header, footer, and sidebar code you will need to construct your page.  In the main body of the template place the following iframe code:</p>

<pre><code>&lt;iframe src=&quot;http&#58;&#47;&#47;yourfeedblog.blogspot.com&#47;&quot; width=&quot;630&quot; height=&quot;2000&quot; frameborder=&quot;0&quot;&gt;&lt;&#47;iframe&gt;</code></pre>

<p>Replace "http://yourfeedblog.blogspot.com" with the URL of your feed blog.  Change the width and height to be appropriate for the space into which the feed is going.  </p>

<p>Save and publish.</p>

<p>That's it!  As you add more blogs to your Blog List, you may need to increase the height of the iframe.</p>]]>
    </content>
</entry>

<entry>
    <title>MultiBlog and Upgrading to MT4</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/06/multiblog-and-upgrading-to-mt4.php" />
    <id>tag:learningmt4.com,2008://1.198</id>

    <published>2008-06-08T18:46:45Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>If you use the MultiBlog plugin by David Rayners and you upgrade to MT4, when you go to rebuild your site, you may get the following error message: &quot;Publish error in template &apos;Main Index&apos;: No handler exists for tag MultiBlogEntries&quot;...</summary>
    <author>
        <name>Elise</name>
        <uri>http://elise.com</uri>
    </author>
    
        <category term="Plugins" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="mt4" label="MT4" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="multiblog" label="MultiBlog" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="upgrade" label="Upgrade" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>If you use the MultiBlog plugin by David Rayners and you upgrade to MT4, when you go to rebuild your site, you may get the following error message:</p>

<p>"Publish error in template 'Main Index': No handler exists for tag MultiBlogEntries"</p>

<p>The MultiBlog functionality is now part of MT4.  All you have to do to update your templates is to change every instance of the tags MTMultiBlogEntries or MTMulitBlog to MTEntries and rebuild your templates.</p>

<p>So &lt;MTMultiBlogEntries include_blogs=&quot;2,5&quot; lastn=&quot;10&quot;&gt; and &lt;&#47;MTMultiBlogEntries&gt; become &lt;MTEntries include_blogs=&quot;2,5&quot; lastn=&quot;10&quot;&gt; and &lt;&#47;MTEntries&gt;.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Get An Email List of All Authors On Your System</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/03/email-list-of-all-authors-on-your-system.php" />
    <id>tag:learningmt4.com,2008://1.197</id>

    <published>2008-03-13T17:27:56Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>This article was first published at Movable Tweak. This little snip of code will dump out a list of all the users and their email addresses on your install in a comma-delimited format that you can easily import into your...</summary>
    <author>
        <name>Jesse Gardner</name>
        <uri>http://plasticmind.com</uri>
    </author>
    
        <category term="Authors" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Email" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Templates" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="authors" label="Authors" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="email" label="Email" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="templates" label="Templates" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p><em>This article was first published at <a href="http://www.movabletweak.com/templates/email_list_of_all_authors.php">Movable Tweak</a>.</em></p>

<p>This little snip of code will dump out a list of all the users and their email addresses on your install in a comma-delimited format that you can easily import into your email client.  It&#8217;s particularly useful on larger installs:</p>

<pre><code>&lt;mt:Authors include_blogs="all"&gt;
    &lt;mt:IfNonEmpty tag="AuthorEmail"&gt;
        &lt;mt:IfNonEmpty tag="AuthorDisplayName"&gt;"&lt;mt:AuthorDisplayName /&gt;" &lt;/mt:IfNonEmpty&gt;
        &amp;lt;&lt;mt:AuthorEmail /&gt;&amp;gt;,
    &lt;/mt:IfNonEmpty&gt;
&lt;/mt:Authors&gt;
</code></pre>

<p>And the <a href="http://www.movabletype.org/documentation/appendices/tags/authors.html">Authors tag</a> allows for all sorts of cool filtering attributes so you can get at any group of authors in the system, ordered however you like:</p>

<ul>
<li>display_name: Specifies a particular author to select.</li>
<li>lastn: Limits the selection of authors to the specified number.</li>
<li>sort<em>by: Supported values: display</em>name, name, created_on.</li>
<li>sort_order: Supported values: ascend, descend.</li>
<li>roles: comma separated list of values. eg &#8220;Author, Commenter&#8221;</li>
<li>need_entry: 1 | 0 (default is 1)</li>
<li>status: Supported values: enabled, disabled. Default is enabled.</li>
</ul>

<p><strong>Note:</strong> Some people have asked about creating an email list of all the commenters on the system, and it&#8217;s very simple.  The code stays the same, but you just need to specify roles=&#8221;Commenter&#8221; and need_entry=&#8221;0&#8221; (since most commenters won&#8217;t have written an entry).  Here&#8217;s the code to do it:</p>

<pre><code> &lt;mt:Authors include_blogs="all" roles="Commenter" need_entry="0" sort_by="display_name"&gt;&lt;mt:IfNonEmpty tag="AuthorEmail"&gt;&lt;mt:IfNonEmpty tag="AuthorDisplayName"&gt;"&lt;mt:AuthorDisplayName /&gt;" &lt;/mt:IfNonEmpty&gt;&amp;lt;&lt;mt:AuthorEmail /&gt;&amp;gt;, &lt;/mt:IfNonEmpty&gt;
 &lt;/mt:Authors&gt;
</code></pre>

<p>Notice the code is much more compressed than the code given previously.  If you tried the previous code, you probably noticed that the spacing is crazy because of all the hard returns and spaces we have in there.  This second set of code I posted will give you a highly compact list of email addresses than can literally be copied and pasted into an email client.</p>

<p><strong>Just make sure you use this for good, not evil.</strong></p>
]]>
        

    </content>
</entry>

<entry>
    <title>Upgrading to MT4</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/02/upgrading-to-mt4.php" />
    <id>tag:learningmt4.com,2008://1.196</id>

    <published>2008-02-16T08:02:04Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>Over the last few major version changes, Learning Movable Type has published guides to upgrading safely, without risk of messing up your blog. The most recent tutorial was A Safe Way to Upgrade to MT3.3. The three main steps that...</summary>
    <author>
        <name>Elise</name>
        <uri>http://elise.com</uri>
    </author>
    
        <category term="Install" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="mt4" label="MT4" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="upgrade" label="Upgrade" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>Over the last few major version changes, Learning Movable Type has published guides to upgrading safely, without risk of messing up your blog.  The most recent tutorial was <a href="http://www.learningmovabletype.com/a/00156633_safe_upgrading/">A Safe Way to Upgrade to MT3.3</a>.</p>

<p>The three main steps that still hold for safely upgrading to MT4 (from MT3) are:</p>

<ol>
<li>Make a <a href="http://www.sixapart.com/movabletype/docs/3.2/01_installation_and_upgrade/mysql_backup_restore.html">back up of your database</a>.</li>
<li>Make sure all the plugins you use for your site have upgrades that are compatible with the new version.</li>
<li>Install MT into a new directory in your cgi-bin.  Do NOT overwrite your existing MT directory.</li></ol>

<p>The Movable Type ProNet community has done a stellar job in outlining everything you need to know to do a successful upgrade to MT4.  These instructions can be found at the MT Community Wiki in the <a href="http://wiki.movabletype.org/Community_Generated_Upgrade_Guide">Community Generated Upgrade Guide</a>.</p>

<p>Please see the instructions at the Community Wiki for the specific details on how to safely upgrade your MT blog to MT version 4.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Creating a Google Toolbar Button for Your Blog</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/02/creating-a-google-toolbar-button-for-your-blog.php" />
    <id>tag:learningmt4.com,2008://1.195</id>

    <published>2008-02-16T06:28:02Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>Creating a custom button for your blog to be used on the Google Toolbar is a great way to promote your blog. Once installed, the button can act as a graphical bookmark to your site. You and your readers can...</summary>
    <author>
        <name>Elise</name>
        <uri>http://elise.com</uri>
    </author>
    
        <category term="Feeds" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Marketing and Money" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Weblog Goodies" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="favicon" label="Favicon" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="googletoolbar" label="Google Toolbar" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>Creating a custom button for your blog to be used on the Google Toolbar is a great way to promote your blog.  Once installed, the button can act as a graphical bookmark to your site.  You and your readers can search your site using the search bar in the Google toolbar, without having to be on your site.  In fact, you can highlight any text on any web page, click on your custom icon in the browser, and you will perform a search the text you just highlighted on your blog.  The custom button can even list your last several entries, with data pulled from your feed.</p>

<p><img alt="Google toolbar example" src="http://www.learningmt4.com/images/toolbar-example.jpg" /></p>

<p>I recently updated my Google toolbar for <a href="http://simplyrecipes.com">Simply Recipes</a> and created a new one for a new site, <a href="http://foodblogsearch.com/about.php">Food Blog Search</a>.  (If you want to see the Google Toolbar in action, follow the instructions to add a button on the Food Blog Search site.)  Google's instructions for making a custom button can be convoluted and overwhelming.  It took me several hours over several days to work out the correct code for the toolbars.  So to save any of you similar pain, I'm presenting the steps here.</p>

<h3>Step 1: Install Google Toolbar</h3>

<p>The Google Toolbar requires using either IE or Firefox for your browser.  Go to <a href="http://www.google.com/tools/firefox/toolbar/FT3/intl/en/index.html">this page</a> at Google to install it.</p>]]>
        <![CDATA[<h3>Step 2: Create an Icon for Your Toolbar Button</h3>

<p>Your Toolbar button is a graphical icon, 16x16 pixels in size.  A favicon works well for this use; if you use a gif file, you can make the background transparent.  (See more tips in Google's <a href="http://www.google.com/tools/toolbar/buttons/apis/howto_guide.html#makeicons">How to make good looking icons</a>.)  You will need to display this graphic as code in the next step.  To do that, go to <a href="http://www.motobit.com/util/base64-decoder-encoder.asp">this site</a>.  Use the "Browse..." button to select the file you want to encode, then click the "Convert the source data" button to start the encoding. Copy and paste the resulting code someplace where you can get to it for the next step.</p>

<p>Here is the encoded output for this icon example <img alt="favicon example" src="http://learningmt4.com/images/favicon-tomato.gif" />:</p>

<pre><code>R0lGODlhEAAQAOYAAAAAAP///4AZG3sYGYkcHZUfIaEiJJwhIrcoKaYkJsYsLcYsLsMrLcIrLMIr
LbspLLYoKtEvMMwuL8wuMMotL8ktLsktL8gtLsctL8UsLcQsLcQsLsMsLcErLMArLM8vMMsuL8Yt
LsIsLVEMD1MOEWsUF3oYG3AWGo8dIIwdIqEiJSsEBhMCA1gOEoMbIHkZHjAGCQgBAoJ0d19WWAMA
AQ4KDFRSVD48P6OjpBgeIIiOjmZoaJiamqSlpYCBgVVcWyQmJSQ0KTE4MyAxJBk9IVRZVSBFJTRs
PCxXMihTLUB7RxIvFBo9HQcaCCFKIgACAAABAAIIAgcaBwEDARoeGkdJR3t8e7Cxq1VVRmFfT7e2
r6OinHp0VqWgjg0LBVlSP3x2aW1rZ1VCN5aNiQkEA0AHA1E+PRsBAC8FA60lILUnIxwBASkEBEII
B6klJcwuLpiXl7u7u6KiomZmZmVlZV5eXlpaWlBQUDU1NS4uLv///wAAAAAAAAAAAAAAAAAAACH5
BAEAAHoALAAAAAAQABAAAAe5gHqCgnF2g4eIVgBSU3KIj1RGSE88gj5Aj3o2TkpNOHpBS3iZekNH
STdCTEWkejleRFFQVZk6NWgEEAIrAD90eXc9gnBlbiEgCiAeKS8nLiQ0O3ozaiAcDSINGhQgIBIS
CWd1MmkLHCIODg3q6g0RJnNjBRbt6dftEyNbWi0f9ugc2FUwQEYQCxVvGLRrcA7DhjVdBsVAwWDC
hQwaLkjo0AYLIjAwSqh4gODAADZZSF0JY0bMFy6IAgEAOw==</code></pre>

<p><br />
<h3>Create a ToolBar XML file</h3></p>

<p>You will be creating an XML file that Google will access when a reader requests to add your toolbar button.  If you are using Movable Type, you may as well create an index template in MT for this task.  It's not necessary, but it will make it easier to troubleshoot and edit.</p>

<p>The basic XML template is structured like this:</p>

<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;custombuttons xmlns=&quot;http&#58;&#47;&#47;toolbar.google.com&#47;custombuttons&#47;&quot;&gt;
  &lt;button&gt;
    &lt;title&gt;Blog Title&lt;&#47;title&gt;
    &lt;description&gt;Blog Description&lt;&#47;description&gt;
    &lt;site&gt;URL&lt;&#47;site&gt;
    &lt;search&gt;Search results page and search query&lt;&#47;search&gt;
    &lt;send&gt;Search results page and text selection query&lt;&#47;send&gt;
    &lt;feed refresh-onclick=&quot;true&quot;&gt;Feed URL&lt;&#47;feed&gt;
     &lt;icon mode=&quot;base64&quot; type=&quot;image&#47;x-icon&quot;&gt;Base64 encoded graphic icon&lt;&#47;icon&gt;
  &lt;&#47;button&gt;
&lt;&#47;custombuttons&gt;</code></pre>

<p>Copy and paste the above code into your new index template.</p>

<p>The following is an (untested) example of template that uses MT tags.  </p>

<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;custombuttons xmlns=&quot;http&#58;&#47;&#47;toolbar.google.com&#47;custombuttons&#47;&quot;&gt;
  &lt;button&gt;
    &lt;title&gt;&lt;$MTBlogName$&gt;&lt;&#47;title&gt;
    &lt;description&gt;&lt;$MTBlogDescription$&gt;&lt;&#47;description&gt;
    &lt;site&gt;&lt;$MTBlogURL$&gt;&lt;&#47;site&gt;
    &lt;search&gt;SearchURL?q={query}&lt;&#47;search&gt;
    &lt;send&gt;SearchURL?q={selection}&lt;&#47;send&gt;
    &lt;feed refresh-onclick=&quot;true&quot;&gt;Feed URL&lt;&#47;feed&gt;
     &lt;icon mode=&quot;base64&quot; type=&quot;image&#47;x-icon&quot;&gt;Base64 encoded graphic icon&lt;&#47;icon&gt;
  &lt;&#47;button&gt;
&lt;&#47;custombuttons&gt;</code></pre>

<p>Whether you use MT tags or whether you just write in the information, the first part of the template is pretty straight forward.  Write out the blog title, the blog description, and the URL where your blog is located.  The feed URL is pretty straightforward too.</p>

<p>The <b>tricky part</b> is what comes between the <code>&lt;search&gt;&lt;&#47;search&gt;</code> and <code>&lt;send&gt;&lt;&#47;send&gt;</code> tags.  </p>

<p>To best figure out the correct code to put between those tags, do the following.</p>

<p>If you are using Google Search on your site (as many of us do), make sure you are using either IE or Firefox, right-click in the search field bar of your search bar, and scroll down to where it says "Generate Custom Search"</p>

<p><img alt="generate-cust-search.jpg" src="http://www.learningmt4.com/images/generate-cust-search.jpg" /></p>

<p>Click on that.  Select "Add" when prompted to add this Custom Button to your Google Toolbar.  You will remove this button later.  This is only to test what search string gets generated when you use the Google Toolbar to do a search with the button.  Type something into the Google search field in the Toolbar and click on your new site toolbar button (the one that just got added).  This should launch a search.  </p>

<p><img alt="Toolbar instructions" src="http://www.learningmt4.com/images/toolbar-instructions.jpg" /></p>

<p>Copy and paste the URL that appears for your search in a safe place.  In the case of my example, the URL that I get when I do a search for apple pie is the following:</p>

<pre><code>http://foodblogsearch.com/food-blog-search-results.php?cx=003084314295129404805%3A72ozi9a0fjk&q=apple+pie&cof=FORID%3A11#1287</code></pre>

<p>Note the query "q=apple+pie" in my example.  You will do something with that shortly.</p>

<p>To use this string in your XML file, you need to encode everything that comes after the question mark.  The encoder I use the most can be found <a href="http://www.lenon.com/modules.php?name=PHP-Nuke_Tools&file=index&func=HTMLENCODER">here</a>.</p>

<p>Doing that, my string now looks like this:</p>

<pre><code>http://foodblogsearch.com/food-blog-search-results.php?cx=003084314295129404805&#37;3A72ozi9a0fjk&amp;q=apple+pie&amp;cof=FORID&#37;3A11#1287</code></pre>

<p>The next step is to swap out "q=apple+pie" for "q={query]"  so that my final string looks like this:</p>

<pre><code>http://foodblogsearch.com/food-blog-search-results.php?cx=003084314295129404805&#37;3A72ozi9a0fjk&amp;q={query]&amp;cof=FORID&#37;3A11#1287</code></pre>

<p>Place this line of code between the search tags in your XML template.</p>

<p>Next copy the same line of code and place it between the <code>send</code> tags in the XML template, but replace the word "query" with "selection".</p>

<p>Here is my Food Blog Google Toolbar XML template, ready to go:</p>

<pre><code>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;custombuttons xmlns=&quot;http&#58;&#47;&#47;toolbar.google.com&#47;custombuttons&#47;&quot;&gt;
  &lt;button&gt;
    &lt;title&gt;Food Blog Search&lt;&#47;title&gt;
    &lt;description&gt;Search over a thousand fabulous food blogs&lt;&#47;description&gt;
    &lt;site&gt;http&#58;&#47;&#47;foodblogsearch.com&#47;&lt;&#47;site&gt;
    &lt;search&gt;http&#58;&#47;&#47;foodblogsearch.com&#47;food-blog-search-results.php?cx=003084314295129404805&amp;#37&#59;3A72ozi9a0fjk&amp;amp&#59;q={query}&amp;amp&#59;cof=FORID&amp;#37&#59;3A11#1320&lt;&#47;search&gt;
    &lt;send&gt;http&#58;&#47;&#47;foodblogsearch.com&#47;food-blog-search-results.php?cx=003084314295129404805&amp;#37&#59;3A72ozi9a0fjk&amp;amp&#59;q={selection}&amp;amp&#59;cof=FORID&amp;#37&#59;3A11#1320&lt;&#47;send&gt; 
     &lt;icon mode=&quot;base64&quot; type=&quot;image&#47;x-icon&quot;&gt;R0lGODlhEAAQAOYAAAAAAP&#47;&#47;&#47;4AZG3sYGYkcHZUfIaEiJJwhIrcoKaYkJsYsLcYsLsMrLcIrLMIr
LbspLLYoKtEvMMwuL8wuMMotL8ktLsktL8gtLsctL8UsLcQsLcQsLsMsLcErLMArLM8vMMsuL8Yt
LsIsLVEMD1MOEWsUF3oYG3AWGo8dIIwdIqEiJSsEBhMCA1gOEoMbIHkZHjAGCQgBAoJ0d19WWAMA
AQ4KDFRSVD48P6OjpBgeIIiOjmZoaJiamqSlpYCBgVVcWyQmJSQ0KTE4MyAxJBk9IVRZVSBFJTRs
PCxXMihTLUB7RxIvFBo9HQcaCCFKIgACAAABAAIIAgcaBwEDARoeGkdJR3t8e7Cxq1VVRmFfT7e2
r6OinHp0VqWgjg0LBVlSP3x2aW1rZ1VCN5aNiQkEA0AHA1E+PRsBAC8FA60lILUnIxwBASkEBEII
B6klJcwuLpiXl7u7u6KiomZmZmVlZV5eXlpaWlBQUDU1NS4uLv&#47;&#47;&#47;wAAAAAAAAAAAAAAAAAAACH5
BAEAAHoALAAAAAAQABAAAAe5gHqCgnF2g4eIVgBSU3KIj1RGSE88gj5Aj3o2TkpNOHpBS3iZekNH
STdCTEWkejleRFFQVZk6NWgEEAIrAD90eXc9gnBlbiEgCiAeKS8nLiQ0O3ozaiAcDSINGhQgIBIS
CWd1MmkLHCIODg3q6g0RJnNjBRbt6dftEyNbWi0f9ugc2FUwQEYQCxVvGLRrcA7DhjVdBsVAwWDC
hQwaLkjo0AYLIjAwSqh4gODAADZZSF0JY0bMFy6IAgEAOw==&lt;&#47;icon&gt;
  &lt;&#47;button&gt;
&lt;&#47;custombuttons&gt;</code></pre>

<p>Once you have built your XML template, save and publish it.  Pick an output file name like <code>toolbar_button.xml</code>.</p>

<p>For more customizations and information about what kinds of toolbar buttons you can create, see Google's <a href="http://www.google.com/tools/toolbar/buttons/apis/howto_guide.html">Guide to Making Custom Buttons</a>.</p>

<h3>Test Your Toolbar Button</h3>

<p>Publish a link promoting your toolbar on your site.  Use the following structure for the link:</p>

<pre><code>&lt;a href=&quot;http&#58;&#47;&#47;toolbar.google.com&#47;buttons&#47;add?url=&lt;$MTBlogURL$&gt;toolbar_button.xml&quot;&gt;add this blog&#39;s button to your Google toolbar&lt;&#47;a&gt;</code></pre>

<p>Then try out the link to see if it works.  If you get an error message, then something isn't working right in your XML code.  All the fields listed do need to be filled in.  For example, make sure you have a description between the description tags.  You might have to troubleshoot the code between the search and send tag sets.</p>

<h3>Promote Your Toolbar Button</h3>

<p>Google maintains a <a href="http://www.google.com/ig/directory?synd=toolbar&frontpage=1">gallery of toolbar buttons</a> which is a great place to promote your button.  Use Google's <a href="http://www.google.com/ig/submit?synd=toolbar">submission form</a> to submit your button to the gallery.</p>

<p><b>Links:</b><br />
<a href="http://www.google.com/tools/toolbar/buttons/apis/howto_guide.html">Guide to making custom buttons for Google Toolbar 5</a></p>]]>
    </content>
</entry>

<entry>
    <title>Template Macros: The coolest template trick you don&apos;t know about</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/02/template-macros-the-coolest-template-trick-you-don.php" />
    <id>tag:learningmt4.com,2008://1.194</id>

    <published>2008-02-15T19:42:22Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>Recently when working on updating the Photo Gallery plugin to work with Movable Type 4.1 I found myself neck deep in some of the most complicated Movable Type templates I have ever seen. Of course, their complexity is exactly why...</summary>
    <author>
        <name>Byrne Reese</name>
        <uri>http://majordojo.com</uri>
    </author>
    
        <category term="Tags" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Templates" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="macros" label="macros" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mtsetvartemplate" label="MTSetVarTemplate" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="templatetags" label="template tags" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="templates" label="templates" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>Recently when working on updating the <a href="http://www.majordojo.com/2008/02/stop-design-photo-gallery-plugin-for-movable-type-41.php">Photo Gallery plugin</a> to work with Movable Type 4.1 I found myself neck deep in some of the most complicated Movable Type templates I have ever seen. Of course, their complexity is exactly why the Photo Gallery plugin outputs such beautiful <a href="http://www.majordojo.com/photos/">results</a>.</p>

<p>Within these templates I have the need to take an arbitrary image asset of any size, and scale it proportionally to fit inside a well defined area. This could be a thumbnail, or a larger version of the photo at hand. What I found myself doing is replicating the same template code over and over again in order to produce the output I desired throughout the template set. Here is the template code I was using:</p>

<pre><code>&lt;MTSetVarBlock name="width" trim="1"&gt;&lt;MTEntryAssets&gt;&lt;MTAssetProperty 
    property="image_width"&gt;&lt;/MTEntryAssets&gt;&lt;/MTSetVarBlock&gt;
&lt;MTSetVarBlock name="height" trim="1"&gt;&lt;MTEntryAssets&gt;&lt;MTAssetProperty 
    property="image_height"&gt;&lt;/MTEntryAssets&gt;&lt;/MTSetVarBlock&gt;
&lt;mt:if name="width" gt="$height"&gt;
    &lt;MTSetVarBlock name="img"&gt;&lt;MTEntryAssets&gt;&lt;mt:AssetThumbnailLink width="90" 
        regex_replace="/^&lt;a[^&gt;]*&gt;(&lt;img[^&gt;]*&gt;)&lt;\/a&gt;$/","$1" /&gt;&lt;/MTEntryAssets&gt;&lt;/MTSetVarBlock&gt;
&lt;mt:else&gt;
    &lt;MTSetVarBlock name="img"&gt;&lt;MTEntryAssets&gt;&lt;mt:AssetThumbnailLink height="90" 
        regex_replace="/^&lt;a[^&gt;]*&gt;(&lt;img[^&gt;]*&gt;)&lt;\/a&gt;$/","$1" /&gt;&lt;/MTEntryAssets&gt;&lt;/MTSetVarBlock&gt;
&lt;/mt:if&gt;
</code></pre>

<p>Yikes.</p>

<p>To complicate things further, each time I cut and pasted this code around I had to modify it slightly depending upon the size of the photo I wanted to output. This presented the following problems:</p>

<ul>
<li>my template code was getting <em>very</em> messy.</li>
<li>my template code was getting harder and harder to update because I had the same code in multiple places</li>
</ul>

<p>What I found myself in need of is something a developer might call a "function" or "macro." In layman's terms, I needed a way to write this template code once, and then to invoke along with a few parameters in order to change its behavior and output as needed.</p>

<p>Luckily, Movable Type has exactly what I needed: a little template tag called <a href="http://www.movabletype.org/documentation/appendices/tags/setvartemplate.html"><code>MTSetVarTemplate</code></a>. This template tag allowed me to define just such a macro so that I could reduce all of the complicated template code above into something <em>far</em> simpler:</p>

<pre><code>&lt;MTVar name="photo" max_size="90"&gt;
</code></pre>

<p>Wow, what an improvement!</p>
]]>
        <![CDATA[<p>To achieve this I defined the following template code inside of a template module I created. I then included that module in my header to ensure that I could use it anywhere I needed within my templates I needed to:</p>

<pre><code>&lt;mt:ignore&gt;
  This template module is responsible for outputting the associated image with the current
  photo/entry in context. You can pass in the max_size parameter to control the size of 
  the image.
  Example:
    &lt;mt:getvar name="photo" max_size="90"&gt;
&lt;/mt:ignore&gt;
&lt;MTSetVarTemplate name="photo"&gt;
&lt;MTSetVarBlock name="width" trim="1"&gt;&lt;MTEntryAssets&gt;&lt;MTAssetProperty property="image_width"&gt;&lt;/MTEntryAssets&gt;&lt;/MTSetVarBlock&gt;
&lt;MTSetVarBlock name="height" trim="1"&gt;&lt;MTEntryAssets&gt;&lt;MTAssetProperty property="image_height"&gt;&lt;/MTEntryAssets&gt;&lt;/MTSetVarBlock&gt;
&lt;mt:if name="width" gt="$height"&gt;
        &lt;MTSetVarBlock name="img"&gt;&lt;MTEntryAssets&gt;&lt;mt:AssetThumbnailLink width="$max_size" regex_replace="/^&lt;a[^&gt;]*&gt;(&lt;img[^&gt;]*&gt;)&lt;\/a&gt;$/","$1" /&gt;&lt;/MTEntryAssets&gt;&lt;/MTSetVarBlock&gt;
&lt;mt:else&gt;
        &lt;MTSetVarBlock name="img"&gt;&lt;MTEntryAssets&gt;&lt;mt:AssetThumbnailLink height="$max_size" regex_replace="/^&lt;a[^&gt;]*&gt;(&lt;img[^&gt;]*&gt;)&lt;\/a&gt;$/","$1" /&gt;&lt;/MTEntryAssets&gt;&lt;/MTSetVarBlock&gt;
&lt;/mt:if&gt;
&lt;mt:getvar name="img" trim="1"&gt;
&lt;/MTSetVarTemplate&gt;
</code></pre>

<p>This is still a lot to chew on, so let me break down exactly what is going on:</p>

<ul>
<li>First, I use the <code>&lt;mt:ignore&gt;</code> tag to document what I had done and allow others to more easily re-use the module I created.</li>
<li>I define the name of the macro by using the <code>name</code> attribute on the <code>&lt;mt:setvartemplate&gt;</code> tag.</li>
<li>I invoke the macro, by using the <code>&lt;mt:getvar&gt;</code> tag.</li>
<li>I am able to access parameters I pass into the macro using a common programming syntax, in this case using the <code>$max_size</code> variable.</li>
<li>I am able to pass parameters into the macro by including them in my <code>&lt;mt:getvar&gt;</code> tag like any other attribute. For example (notice the <code>max_size</code> attribute corresponding to the variable of the same name inside of my macro):
<mt:var name="photo" max_size="90"></li>
</ul>

<p>I can't tell you how pleasantly surprised to find this feature. Using it greatly improved the readability of my templates, and also made them much each to maintain over time. And now looking back i can think of a million places through out my templates on every site I have ever worked on where this could really help make my template simpler and easier to maintain.</p>
]]>
    </content>
</entry>

<entry>
    <title>How to Customize Default Styles in MT4</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/02/how-to-customize-default-styles-in-mt4.php" />
    <id>tag:learningmt4.com,2008://1.193</id>

    <published>2008-02-10T22:04:05Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>Okay, so you&apos;ve created a new blog in MT4. You&apos;ve followed the system prompts and have picked a style from the available defaults. Now you want to customize the style you&apos;ve chosen, perhaps use a different font, or a different...</summary>
    <author>
        <name>Elise</name>
        <uri>http://elise.com</uri>
    </author>
    
        <category term="Beginner Tips" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Style" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Templates" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="mt4" label="MT4" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="styles" label="Styles" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="stylesheet" label="Stylesheet" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="templates" label="Templates" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>Okay, so you've created a new blog in MT4.  You've followed the system prompts and have picked a style from the available defaults.  Now you want to customize the style you've chosen, perhaps use a different font, or a different color for an element.  You go to look at the stylesheet template in Design > Templates > Stylesheet, and instead of seeing CSS code to edit, you see this:</p>

<p><span class="mt-enclosure mt-enclosure-image"><a href="http://www.learningmt4.com/images/lmt-edit-stylesheet1.php" onclick="window.open('http://www.learningmt4.com/images/lmt-edit-stylesheet1.php','popup','width=723,height=353,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.learningmt4.com/images/lmt-edit-stylesheet-thumb-500x244.jpg" width="500" height="244" alt="lmt-edit-stylesheet.jpg" /></a></span></p>

<p>Now what?</p>]]>
        <![CDATA[<p>MT4 uses a modular template structure, pulling in files from other places to construct a template.  The most kosher way to easily make adjustments to a default style is to create a separate index file with the CSS code in it that you want to change from the default.  Then import that file into your stylesheet template.  Stylesheet code "cascades", so that whatever code comes last in the file takes precedence over what came before it.  Here are the basic steps to customizing your default stylesheet.</p>

<p><b>1. Create a new index template.</b>  Go to Design > Templates > +Create Index Template.  You can keep the template itself blank for now, but give it a title like "Style Customizations".  Set an output file with the ending .css, for example custom.css.  Save and publish the template.</p>

<p><b>2.  Include your new template into the stylesheet template.</b> Go to Design > Templates > Stylesheet.  Add the following code to a new line in the stylesheet:</p>

<pre><code>@import url(<$MTLink template="Style Customizations"$>);</code></pre>

<p>Save and publish the stylesheet template.  Now when you make changes to your customization template, they will be published to the overall stylesheet.</p>

<p><b>3.  Decide what customizations you want to make.</b>  It helps to know what CSS classes and IDs you are working with to begin with.  Take a look at the existing CSS file.  You can find the URL by doing a view source of your published blog, or by looking at the partial URL in the stylesheet template.  The main CSS for the minimalist red them is http://www.your-blog-domain.com/mt-static/themes/minimalist-red/screen.css.</p>

<p>A great way to test out your CSS changes in real time is to use the <a href="http://www.movabletype.org/design/assistant/">MT Design Assistant</a>.  The Design Assistant has the default MT designs, and you can get an idea of what the various elements of the stylesheet do by making customizations and seeing them reflected on the test page in front of you.  Go to <a href="http://www.movabletype.org/design/assistant/">http://www.movabletype.org/design/assistant/</a>.  Click "Get Started".  Select "Choose a Style" to select a starting style.  Select "Select a Layout" to pick your layout.  Then select "Customize CSS".   In the window on the right side of the screen, you can type in the CSS you want to see applied to your style.  For example, type:  </p>

<p><code>#header-name { font-size: 40px; }</code> </p>

<p>and select "Apply CSS" to see the blog title increase in size.</p>

<p><b>4.  Customize your "Style Customizations" template.</b>  When you are ready, put the style customizations - the new CSS code -  into your new Style Customizations index template.  Save and republish.  View your site.</p>

<p>That's it!  Customizing styles in MT requires a knowledge of <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">Cascading Style Sheets</a> or CSS.   If you need help with this, there are several good CSS books on the market.  Here's a <a href="http://www.html.net/tutorials/css/">CSS Tutorial</a> and a <a href="http://home.tampabay.rr.com/bmerkey/cheatsheet.htm">CSS Cheat Sheet</a>.   </p>

<p><em>Many thanks to Mark Carey of <a href="http://mt-hacks.com/">MT Hacks</a>, <a href="http://plasticmind.com">Jesse Gardner</a>, and Beau Smith of Six Apart for walking me through these steps.</em></p>]]>
    </content>
</entry>

<entry>
    <title>Running Publish Queue under daemontools</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/01/running-publish-queue-under-daemontools.php" />
    <id>tag:learningmt4.com,2008://1.191</id>

    <published>2008-01-27T22:05:45Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>In Movable Type 4.0 users had the option of offloading the task of publishing to a separate program or application called Publish Queue. This had the advantage of dramatically increasing Movable Type&apos;s performance and reliability. Most users run Pubish Queue...</summary>
    <author>
        <name>Byrne Reese</name>
        <uri>http://majordojo.com</uri>
    </author>
    
        <category term="General Tips and Tricks" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Servers" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="daemontools" label="Daemontools" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="publishqueue" label="Publish Queue" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>In Movable Type 4.0 users had the option of offloading the task of publishing to a separate program or application called <a href="http://www.movabletype.org/documentation/administrator/publishing/publish-queue.html">Publish Queue</a>. This had the advantage of dramatically increasing Movable Type's performance and reliability. </p>

<p>Most users run Pubish Queue via a scheduled task that wakes up at a fixed internal, executes and then quits. However, some users use Publish Queue's "daemon mode" to make it so that it is always running. But its own daemon mode does not have the capability to monitor and restart itself should it unexpectedly quit, exit or die.</p>

<p>Should Publish Queue crash the consequence would be that publishing would simply stop without you ever really knowing about it. Plus you couldn't start it up again without you manually going into the server and starting the publish queue up again. This rarely happens in actuality, but in a business critical application, you <em>never want this to happen. Period.</em></p>

<p>Of course this problem is not unique to Movable Type. Many programs in Linux should be running at all times to ensure that the operating system functions properly. That is why there exists a suite of utilities in Linux called "damon tools." Together these tools can be configured to monitor <em>any</em> script and ensure that it is always running. If the script/application dies, then daemon tools will restart it. Handy.</p>

<p>This article discussed the process for those unfamiliar with daemon tools with how to get started and how to configure it so that you can relax knowing that Movable Type's background publishing engine will never stop running.</p>
]]>
        <![CDATA[<p>Ok, before we get started I have to admit something: this article is a little technical. <em>cough</em>. It requires an above average knowledge of Linux and requires people to interact with a command line that many are not comfortable doing. If you are one of those people then your key take away from this article is the knowledge that a solution exists to this problem. Your job will then be to send a link to this article to your system administrator or a more technical friend or yours and tell them, "help me do <em>this</em>."</p>

<p>For all the technical folks who are sticking around, this article will show you how to start up Publish Queue and have it monitored by <a href="http://www.daemon-tools.cc/dtcc/announcements.php">daemon tools</a> so that it will automatically be restarted (or "respawned" to use the proper term) if the process for whatever reason dies.</p>

<p><strong>Prerequisites</strong></p>

<p>You will need each of the following:</p>

<ul>
<li>Movable Type 4.0 or greater</li>
<li>daemon tools, a Linux package</li>
</ul>

<p>The simplest way to install daemon tools is via yum or apt. For example, running the following command as root should do the trick:</p>

<pre><code>yum install daemontools
</code></pre>

<p>If this doesn't work or is not appropriate for you Linux distribution, then I must refer you to the daemon tools website to follow their more <a href="http://www.daemon-help.com/index.php?id=installation_lite">specific instructions</a>.</p>

<p><strong>Setting up the Publish Queue service</strong></p>

<p>Once daemon tools is installed you need to create a script that will be run anytime the system wants to start or respawn Publish Queue. This is done by creating a few directories and files on your system. Execute the following command:</p>

<blockquote>
  <p>mkdir /etc/publishqueue</p>
</blockquote>

<p>Then create a file called <code>/etc/publishqueue/run</code> and enter the following contents into the file:</p>

<pre><code>#!/bin/sh
MT_HOME=/var/www/cgi-bin/mt
cd $MT_HOME
exec ./tools/run-periodic-tasks -daemon
</code></pre>

<p>Change the value of <code>MT_HOME</code> to be the location of the directory that contains <code>mt.cgi</code>.</p>

<p>Finally, execute the following command:</p>

<pre><code>ln -s /etc/publishqueue /service/publishqueue
</code></pre>

<p>That will setup daemon tools with the correct scripts and handlers to run Publish Queue.</p>

<p><strong>Setting up svscan</strong></p>

<p>A program comes with daemon tools called <code>svscan</code>. It is responsible for monitoring a list of services and if any of them stop running to restart them. In lieu of my documenting the process, let me refer you to a more <a href="http://www.thedjbway.org/svscanboot.html">complete and definitive article that can guide you through this process</a>. There are lots of ways to setup svscan, but I chose to use inittab as the means by which my system will monitor and respawn processes.</p>

<p>Once you have successfully edited <code>/etc/inittab</code> you can execute the following command to complete the entire daemonization process:</p>

<blockquote>
  <p>telinit q</p>
</blockquote>

<p>This command will instruct your system to reprocess <code>/etc/inittab</code> and your publish queue daemon should then start momentarily. Run the following command and see if you can see publish queue running:</p>

<blockquote>
  <p>ps -aef</p>
</blockquote>

<p>You should see something like:</p>

<pre><code>root 30663     1  0 Jan21 ? /bin/sh /usr/local/bin/svscan-start
root 30666 30663  0 Jan21 ? /bin/sh /usr/local/bin/svscan-start
root 30667 30666  0 Jan21 ? svscan /service
root 30669 30667  0 Jan21 ? supervise publishqueue
root 26564 30669  0 04:00 ? /usr/bin/perl -w run-periodic-tasks -daemon
</code></pre>

<p><strong>Summary</strong></p>

<p>And that as they say, is that. I know these instructions can be an intimidating, and hopefully in the future we can find ways to automate this process. In the meantime, I would really like to hear how others have solved this problem. </p>

<p>Also, if you have any questions or problems following the steps above, please leave a comment and I will see if I can't help you resolve your problem.</p>
]]>
    </content>
</entry>

<entry>
    <title>Fighting Hotlinkers with htaccess</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/01/fighting-hotlinkers-with-htaccess.php" />
    <id>tag:learningmt4.com,2008://1.192</id>

    <published>2008-01-27T18:45:55Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>If you have a blog with reasonably well conceived content, and have had this blog for any length of time, you will undoubtedly encounter content scrapers, people bottom-feeding scumbags who republish rip-off your content either from your feed or from...</summary>
    <author>
        <name>Elise</name>
        <uri>http://elise.com</uri>
    </author>
    
        <category term="Spam" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="hotlinking" label="Hotlinking" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="htaccess" label="Htaccess" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="spam" label="Spam" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>If you have a blog with reasonably well conceived content, and have had this blog for any length of time, you will undoubtedly encounter content scrapers, <strike>people</strike> bottom-feeding scumbags who <strike>republish</strike> rip-off your content either from your feed or from your site, to populate their own "made for Adsense" sites.  Often the only recourse left to you is to file a <a href="http://www.learningmovabletype.com/a/001560is_someone_stealing_your_content/">DMCA complaint</a>, which can take over a month to resolve.</p>

<p>If the content scraper is hotlinking your images (pulling the images directly from the files on your server) you can at least shut down the images with a command in your <a href="http://www.learningmovabletype.com/a/000743what_is_htaccess/">htaccess file</a> if your site is hosted on an Apache server.  This is sort of a sledgehammer approach, but if they have scraped your entire site (which happened to me recently), it's a lot easier than changing the file names of every image on your site and rewriting your html code for every entry.</p>]]>
        <![CDATA[<p><img alt="content-scraper.jpg" src="http://www.learningmt4.com/images/content-scraper.jpg" width="400" height="212"/></p>

<p>In the <a href="http://www.learningmovabletype.com/a/000246concerning_spam/">LMT article I wrote about spam</a> years ago, there is a section on "referrer spam".  In that section there is a line of code that you can add to the htaccess file of your blog:</p>

<pre><code>
SetEnvIfNoCase Referrer &quot;.*(casino|gambling|poker|porn|sex|nude|xxx).*&quot; BadReferrer
order deny,allow
deny from env=BadReferrer
</code></pre>

<p>This code blocks access to your site from domains having the listed words in them.  Find the string of characters that is most unique in the domain name of the content scraping site and add it to this list (or replace one of the spammy words), separated by a vertical line.  If that site has been hotlinking images from your site, it will no longer be able to do so.  Note that ANY website with that string will no longer be able to access your site, so be cautious in the words or characters you select.  I once had my recipe site pulled out of completely legitimate feed service because the service's name was "Food Porn watch".  Had to remove that one little p-word from my htaccess code.</p>

<p><em>Like all advice given here on LMT regarding htaccess, know what you're doing before messing with this file.  Or have someone who knows what she or he is doing do it for you.</em></p>]]>
    </content>
</entry>

<entry>
    <title>List Random Authors</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/01/list-random-authors.php" />
    <id>tag:learningmt4.com,2008://1.190</id>

    <published>2008-01-24T06:12:24Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>As communities grow, so does the need to showcase your authors. Having a hefty community of authors is a great thing (content producers FTW!) but everyone wants their fifteen minutes. This handy little tip can help make sure everyone gets...</summary>
    <author>
        <name>Jesse Gardner</name>
        <uri>http://plasticmind.com</uri>
    </author>
    
        <category term="Authors" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="General Tips and Tricks" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PHP" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Templates" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="authors" label="Authors" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="PHP" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="randomauthors" label="Random Authors" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p><strong>As communities grow, so does the need to showcase your authors.</strong>  Having a hefty community of authors is a great thing (content producers FTW!) but everyone wants their fifteen minutes.  This handy little tip can help make sure everyone gets their fair share of the limelight.  </p>

<p>A couple of things to note first:  Make sure that you&#8217;ve got author archives set up.  You can hack this to work with author profiles, but that&#8217;s not the scope of this tutorial.  Also, this tutorial assumes that your server is parsing whatever page this is on as PHP.  As a rule of thumb, if your file extension is .html, this probably won&#8217;t work; if you&#8217;re file extension is .php, you should be fine.</p>

<pre><code>&lt;?php
    $displayed_authors = array(); // Will hold indexes from $authors for authors already displayed
    $show = 25; // How many authors should we show?

    &lt;mt:Authors&gt;
        $authors[&lt;mt:AuthorId /&gt;] = '&lt;li&gt;&lt;a href="&lt;mt:EntryLink archive_type="Author" /&gt;"&gt;&lt;mt:EntryAuthorDisplayName encode_php='1' /&gt;&lt;/a&gt;&lt;/li&gt;';
    &lt;/mt:Authors&gt;

    for ($i=1; $i &lt;= $show; $i++) {
        $rn = array_rand($authors); 
        // Loops until it finds an author not displayed
        while(in_array($rn, $displayed_authors)) {
            $rn = array_rand($authors);
        }
        array_push($displayed_authors, $rn);
        echo $authors[$rn];
    }
?&gt;
</code></pre>

<p>First, we set up an array where we&#8217;ll store all the authors that have already been displayed.  More on that in a minute.  Then we define how many authors we want to show with this block.</p>
]]>
        <![CDATA[<p>Next, we loop through all the authors, stashing them all into an array.  Actually, we&#8217;re stashing the html that we want displayed as it gets looped through.  This can be basically whatever you want.  If you use other Movable Type tags, make sure you add the  <code>encode_php='1'</code> filter or else you could get some nasty PHP parse errors and break your site. (<em>Usually because of single quote/double quote mismatching.</em>)</p>

<p>Next up is displaying the authors.  We&#8217;re going to loop through authors 25 times; remember, that&#8217;s what we set up with the $show variable.  The <code>array_rand</code> function basically says &#8220;pull a random number from 1 to the number of items in our array&#8221;.  We had to put in a special <code>while</code> loop to make sure it didn&#8217;t pick a number already used; this would result in duplicate listings of a single author.  The <code>array_push</code> then stores the new, non-duplicate random number in our displayed authors array to ensure we don&#8217;t duplicate it next time through the loop.</p>

<p>Finally, we echo a random item from the <code>$authors</code> array.  This loops through however many times you&#8217;ve told it to with the <code>$show</code> variable.</p>

<p><strong>Note:</strong> If you want to keep a particular user from showing up in your random list, there are a few ways to accomplish this.  The easiest is to put a <code>&lt;mt:SetVarBlock name="displayname"&gt;&lt;mt:AuthorDisplayName /&gt;&lt;/mt:SetVarBlock&gt;</code> just after the opening <code>&lt;mt:Authors&gt;</code> tag.  Then just wrap the code that populates the $authors array in an <code>&lt;mt:Unless&gt;</code> loop, like so: <code>&lt;mt:Unless name="displayname" eq="John Doe"&gt; $authors[&lt;mt:AuthorID /&gt;]... &lt;/mt:Unless&gt;</code>. </p>

<p><strong>Thanks to <a href="http://movalog.com">Arvind</a> for helping me solve the dupe problem.  He also made me say that I will now worship him forever.</strong></p>
]]>
    </content>
</entry>

<entry>
    <title>Share This Post in Movable Type 4</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2008/01/share-this-post-in-movable-type-4.php" />
    <id>tag:learningmt4.com,2008://1.189</id>

    <published>2008-01-20T03:58:50Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>This isn&apos;t really a tutorial since I&apos;m just advising you to install a plugin and giving you some reference html to make it look a tiny bit nicer than it does by default. However I still think this might be...</summary>
    <author>
        <name></name>
        
    </author>
    
        <category term="General Tips and Tricks" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="HTML and Javascript" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Plugins" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Reference" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="delicious" label="Del.icio.us" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="digg" label="Digg" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugins" label="Plugins" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="socialbookmarking" label="Social Bookmarking" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>This isn't really a tutorial since I'm just advising you to install a plugin and giving you some reference html to make it look a tiny bit nicer than it does by default. However I still think this might be useful information for at least a few people so here we go:</p>

<p>Social bookmarking sites like <a href="http://www.digg.com">Digg</a>, <a href="http://del.icio.us">del.icio.us</a>, <a href="http://www.stumbleupon.com">StumbleUpon</a> and countless others are very popular with blogs and websites. Becoming popular on one of those sites attracts serious traffic and let's face it, most blogs and websites are always looking to boost traffic. So making it easier for people to "add to del.icio.us or "digg this" seems to be a good idea. By making it easier I mean we'll be adding links for several of the most popular social bookmarking tools to all existing and future entries for a given blog. </p>

<p>To accomplish this we're going to use the <a href="http://www.majordojo.com/projects/promote-this.php">Promote This! plugin</a> by Byrne Reese. Download and install the plugin per the directions. Once you've installed the plugin it's time to insert code into the Entry Detail template module. The Promote This! site gives the example of the code for adding a "digg this" link. If you follow that format you'll get a nice text link that works just fine. But if you want to jazz it up a tiny bit you can add the logos for each of the social bookmarking services you want represented. </p>

<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.onapathmedia.com/images/sharethis.html" onclick="window.open('http://www.onapathmedia.com/images/sharethis.html','popup','width=694,height=588,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.onapathmedia.com/images/sharethis-thumb-450x381.png" width="450" height="381" alt="sharethis.png" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></a></span></p>]]>
        <![CDATA[<p>To get those handy little icons for each service you need to grab either the favicons or other logo button provided by the services. In the code below I'm hotlinking to all the images. I don't recommend you do this, it's just to show you the addresses of all the icons so you can grab them yourself and upload them to your own space.</p>

<p>This code will give you quicklinks to the sites that I've chosen to use/link to. Promote This! supports several other sites so feel free to add and subtract links as you like. </p>

<p><code>&lt;strong&gt;Share this post:&lt;/strong&gt;&lt;br/&gt;<br /><br />
&lt;img src="http://digg.com/favicon.ico"&gt;&lt;a href="&lt;$MTDiggURL$&gt;"&gt;digg&lt;/a&gt;<br /><br />
&lt;img src="http://del.icio.us/favicon.ico"&gt;&lt;a href="&lt;$MTdeliciousURL$&gt;"&gt; del.icio.us&lt;/a&gt;<br /><br />
&lt;img src="http://reallystatic.reddit.com/static/favicon.ico"&lt;a href="&lt;$MTredditURL$&gt;"&gt;reddit&lt;/a&gt;<br /><br />
&lt;img src="http://www.newsvine.com/favicon.ico"&gt;&lt;a href="&lt;$MTNewsvineURL$&gt;"&gt;Newsvine&lt;/a&gt;&lt;/td&gt;<br /><br />
&lt;br/&gt;&lt;img src="http://www.google.com/favicon.ico"&gt;&lt;a href="&lt;$MTGoogleURL$&gt;"&gt;Google Bookmark&lt;/a&gt;<br /><br />
&lt;img src="http://www.facebook.com/favicon.ico"&gt;&lt;a href="&lt;$MTFaceBookURL$&gt;"&gt;FaceBook&lt;/a&gt;<br /><br />
&lt;img src="http://www.stumbleupon.com/images/icon_su.gif"&gt;&lt;a href="&lt;$MTStumbleUponURL$&gt;"&gt;Stumble Upon&lt;/a&gt;</code></p>

<p>I've chosen to have links at the end of blog posts, before comments so I've placed the code, in the Entry Detail template module, between<br />
<code>&lt;$MTInclude module="Categories"$&gt;</code><br />
and <code>&lt;$MTInclude module="Tags"$&gt;</code></p>]]>
    </content>
</entry>

<entry>
    <title>How to Export Tags from Movable Type 3.3x</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2007/12/how-to-export-tags-from-movable-type-33x.php" />
    <id>tag:learningmt4.com,2007://1.187</id>

    <published>2007-12-14T14:09:02Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>Jaclyn asked why she wasn&apos;t able to get tags imported to a new MT4 installation. While Movable Type 4 includes an entry&apos;s tags in the import specifications, and also exports those tags when saving the data, no prior versions have...</summary>
    <author>
        <name></name>
        
    </author>
    
        <category term="Install" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tags" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="tags" label="Tags" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p><a href="http://www.learningmovabletype.com/a/tag_cloud_on_php_in_movable_type_4/index.php#comment-10395">Jaclyn asked</a> why she wasn't able to get tags imported to a new MT4 installation.  While <a href="http://www.sixapart.com/movabletype/">Movable Type</a> 4 includes an entry's tags in the import specifications, and also exports those tags when saving the data, no prior versions have exported the tags, even though tags have been natively supported since MT 3.3x.  Luckily, it's easy to get them.</p>

<p>First, make a backup of <strong>ImportExport.pm</strong> from your original Movable Type installation, which is the Perl module that handles the export.  Do this because you want to make sure that you have a good copy, just in case something goes awry.  Put this backup in a safe place, and work with the copy of the file, just in case.  Ready?  Good.</p>]]>
        <![CDATA[<p>Using your copy, open ImportExport.pm and locate the line that looks like this:</p>

<pre>sub export {</pre>

<p>In any version of MT 3.3x (that is, MT 3.31, MT 3.32, MT 3.33, MT 3.34 or MT 3.35), this is on line 516.  This indicates the start of the export subroutine.  Once you have located this line, scroll down a few lines and locate these lines:</p>

<pre>DATE: &lt;$MTEntryDate format="%m/%d/%Y %I:%M:%S %p"$>
-----</pre>

<p>This is where you are going to insert the information.  Change these two lines so that they look like this:</p>

<pre>DATE: &lt;$MTEntryDate format="%m/%d/%Y %I:%M:%S %p"$>&lt;MTEntryIfTagged>
TAGS: &lt;MTEntryTags glue=",">&lt;$MTTagName quote="1"$>&lt;/MTEntryTags>&lt;/MTEntryIfTagged>
-----</pre>

<p>What you have done is insert a section of code that will include the tags only if there are tags on the entry.  Make sure you include the dashes, as that is a necessary part of the formatting.</p>

<p>By wrapping everything in the MTEntryIfTagged container, you are sure to only include the line if the entry in question <em>has</em> tags.  This probably isn't completely necessary, but it makes things tidy, so it's a good idea to include it.  The rest of the line just formats everything correctly, producing the necessary information for a valid import.</p>

<p>After making this change, save your changes and exit.  Then upload the file to your server and run your export again.  Now you should be able to see the tags in your exported file, and you can import these to your MT installation.</p>

<p>There is one difference in this and the MT4 version, and that is that the "include_private" attribute doesn't exist in MT3.  This should mean that you get all the tags on the entry, including private tags.  But just in case, make a note of any private tags that you have, as you might need to update them later.</p>

<p><em>This tutorial is written by LMT author Chad Everett of <a href="http://everitz.com/">Everitz Consulting</a>.<br />
Tutorial cross posted on <a href="http://cxliv.org/2007/12/07/how_to_export_tags_from_movable_type_3.3x.php">Don't Back Down</a> and LMT.</em></p>]]>
    </content>
</entry>

<entry>
    <title>Movable Type Scheduled Tasks</title>
    <link rel="alternate" type="text/html" href="http://learningmt4.com/2007/12/movable-type-scheduled-tasks.php" />
    <id>tag:learningmt4.com,2007://1.186</id>

    <published>2007-12-12T20:53:56Z</published>
    <updated>2009-01-25T07:17:00Z</updated>

    <summary>Movable Type has a scheduled tasks system that is used to perform certain tasks on scheduled basis. Built-in tasks include expiring junk (spam) trackbacks and comments, and posting entries that were scheduled to to published at a certain date /...</summary>
    <author>
        <name></name>
        
    </author>
    
        <category term="Exploring MT" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Plugins" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="administration" label="Administration" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="schedulingposts" label="Scheduling Posts" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://learningmt4.com/">
        <![CDATA[<p>Movable Type has a <em>scheduled tasks</em> system that is used to perform certain tasks on scheduled basis.  Built-in tasks include expiring junk (spam) trackbacks and comments, and posting entries that were scheduled to to published at a certain date / time.  Movable Type plugins can also use scheduled tasks, as some of my plugins do (including <a href="http://mt-hacks.com/visitorstats.html">Visitor Stats Pro</a>, <a href="http://mt-hacks.com/ajaxrating.html">Ajax Rating Pro</a>, and <a href="http://mt-hacks.com/blogjanitor.html">Blog Janitor</a>).  One of the benefit of scheduled tasks is to improvement performance and user experience -- resource intensive functions can be run without making admins, authors, and commenters wait while they complete.</p>

<p><strong>Triggering Scheduled Tasks</strong></p>

<p>Scheduled task will only run when they are <em>triggered</em>.  This is important.  Even if a task is scheduled to run every hour, it scheduled tasks don't get triggered, <em>the task will never run</em>.  By default Movable Type will trigger scheduled tasks in the following cases:</p>

<ol><li>You receive a junk (spam) comment or trackback. <strong>Note: this will <em>only</em> trigger the 'Junk expiration' task - it won't trigger plugin tasks.</strong></li>
<li>You view or download an XML "activity feed" (These feeds show up on with orange feed links on many screens of the admin MT interface, including entry and comment listings, and activity log).</li>
<li>When the <em>run-periodic-tasks</em> script (found in the 'tools' directory of MT) is run via the command line or via cron.</li></ol>]]>
        <![CDATA[<p><strong>Testing Scheduled Tasks</strong></p>

<p>Here is an easily method that I use to test scheduled tasks and make sure they are running correctly:</p>

<ol><li>Go to System Overview > Activity Log.</li>
<li>Click the "Activity Feed" link on the right side of the page.</li>
<li>After the XML feed displays, hit the back button.</li>
<li>Now refresh the System Activity Log.</li>
<li>Read the recent log entries.  If tasks were just triggered, there should be a message stating that tasks were run, along with the names of those tasks.  In addition, some plugin tasks may post custom log messages to the Activity Log, providing more information about the task completed.</li></ol>

<p>Note that in some cases, depending of the task, you may have to rebuild your pages after the task has run, in order to see the results of the task. One example of such a case is my Visitor Stats Pro plugin, in which a scheduled task tallies the page views of each entry, so that they can be displayed in a "Most Read Entries" widget that lists the most popular entries.</p>

<p><strong>Setting Up a Cron Job</strong></p>

<p>To ensure that scheduled tasks get triggered on a regular basis, I recommend setting up a cron job to run the run-periodic-tasks script once per hour. If you are not familiar with setting up cron jobs, please read the following helpful article: <a href="http://www.learningmovabletype.com/a/000757scheduled_posts/">Scheduled Postings and Cron Jobs</a>.</p>]]>
    </content>
</entry>

</feed>
