<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Posts by Chad Everett on Learning Movable Type</title>
   <link rel="alternate" type="text/html" href="http://www.learningmovabletype.com/" />
   <link rel="self" type="application/atom+xml" href="http://www.learningmovabletype.com/contributors/jayseae/" />
   <id>tag:,2008-02-25:/5</id>
   <updated>2008-02-01T15:46:24Z</updated>
   <subtitle>Tutorials and helpful tips for the Movable Type web publishing system</subtitle>
   <generator uri="http://www.movabletype.org/">Movable Type Publishing Platform 4.01</generator>

<entry>
   <title>How to Export Tags from Movable Type 3.3x</title>
   <link rel="alternate" type="text/html" href="http://www.learningmovabletype.com/a/how_to_export_tags_from_movable_type_33x/" />
   <id>tag:www.learningmovabletype.com,2007://5.1988</id>
   
   <published>2007-12-14T14:09:02Z</published>
   <updated>2008-02-01T15:46:24Z</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 exported the tags, even though tags have been natively supported...</summary>
   <author>
      <name>Chad Everett</name>
      <uri>http://everitz.com/</uri>
   </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://www.learningmovabletype.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>Install Movable Type 4 in Yahoo! Small Business</title>
   <link rel="alternate" type="text/html" href="http://www.learningmovabletype.com/a/install_movable_type_4_in_yahoo_small_business/" />
   <id>tag:www.learningmovabletype.com,2007://5.1936</id>
   
   <published>2007-11-09T16:49:14Z</published>
   <updated>2008-02-01T15:46:04Z</updated>
   
   <summary>While it seems that the Yahoo! Small Business web hosting packages continue to offer Movable Type as an option, and there has been some talk about Yahoo! not supporting MT4, while Six Apart doesn&apos;t really seem to support MT4 at Yahoo! Nice, huh? So what are you to do? Or...</summary>
   <author>
      <name>Chad Everett</name>
      <uri>http://everitz.com/</uri>
   </author>
   
      <category term="Install" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="installingmt" label="Installing MT" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="mt4" label="MT4" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="yahoo" label="Yahoo" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.learningmovabletype.com/">
      <![CDATA[<p>While it seems that the <a href="http://smallbusiness.yahoo.com/webhosting/">Yahoo! Small Business web hosting</a> packages continue to offer <a href="http://www.sixapart.com/movabletype/">Movable Type</a> as an option, and there has been <a href="http://www.kadidel.com/2007/09/movable-type-4-and-yahoo.html">some talk</a> about Yahoo! not supporting MT4, while <a href="http://www.sixapart.com/">Six Apart</a> doesn't really seem to support MT4 at Yahoo!</p>

<p>Nice, huh?  So what are you to do?  Or more specifically, what am I to do when I have clients clamoring for MT4 and they are on the Small Business package?  I have to figure out a way to make it work.  Unfortunately, neither Six Apart nor Yahoo! makes it easy.  The good news is that it's quite possible, once you know what you need.  The first suggestion that I have - don't read that long letter that you'll get from Yahoo!, as it won't help tell you what you need to know.</p>]]>
      <![CDATA[<p>You will need to <a href="http://www.movabletype.org/download/">get a copy</a> of MT4.  Go on, I'll wait.  Got it?  Good.  Now go get an FTP program too.  If you don't have one, try <a href="http://www.winscp.net/">WinSCP</a> because it works really well.  Got it?  Good.  Now just one more thing - you need to be able to unpack your distribution.  I like <a href="http://www.rarlabs.com/">WinRAR</a> here, but <a href="http://www.winzip.com/">WinZIP</a> or something should work too.  Got it too?  Good.  Now you're ready to proceed.</p>

<p>First, unpack MT4 to someplace you can find it.  You can put it wherever you like, so long as you'll be able to find it again.  When you do, you'll get a directory named something like <strong>MT-4.01-en</strong>.  You need to rename this directory to whatever the name is where you currently have MT installed on your small business account.  That is, where you log into MT - chances are this is probably going to be <strong>blog-mt</strong>.  If you don't have MT installed already, you'll need to do it first, because I have not been able to get this to work without first having Yahoo! work some magic behind the scenes (I don't know what it is, either).</p>

<p>Now you need to log into your account at Yahoo! to perform a few tasks.  Go to the <strong>Web Hosting Control Panel</strong> and select <strong>Create &amp; Update</strong>, then select <strong>MySQL Database</strong>.  We need to do two things here - first set up an administrator password, then install <a href="http://www.phpmyadmin.net/">phpMyAdmin</a>.</p>

<p>The first step is to assign a password.  Select <strong>Database Administrator</strong>, then a user from the drop-down list.  This drop-down is probably just one name, but if there is more than one, make sure you remember the one you select as you'll need it later.  Then assign a password to the user.  Make sure you assign a good password.  If you need help, try the <a href="http://www.random.org/strings/">random string generator</a>.  I generally create 16-character passwords with numbers, uppercase and lowercase letters.  But that's me.  You can make it whatever you like.</p>

<p>Once you save your password, select <strong>Install Admin Tool</strong>.  You need to agree to the license agreement.  Then create a new directory, and click <strong>Install phpMyAdmin</strong> next to that directory.  Very soon thereafter you are presented with a screen that gives you a link to your newly installed copy of phpMyAdmin - make sure you save this link so you can get to it, because you'll need it.</p>

<p>In fact, you need it right now.  Open phpMyAdmin in Internet Explorer.  Though the standard phpMyAdmin works fine in Firefox and other browsers, the Small Business version does not, so you <em>must</em> open it in Internet Explorer.  Don't forget or you'll be left wondering why it's not working.  Trust me on this one.</p>

<p>Once you do, you need to select your existing Movable Type database from the drop-down in the left column.  By default, this is <strong>mt</strong>.  I don't think that there is any way to change this name, but if there is, you'll know it, so you need to select the name you changed it to instead.</p>

<p>After the database loads, select the <strong>Operations</strong> tab and locate the <strong>Copy Database To</strong> section towards the bottom of the page.  Enter the name of the new database (we're copying here, so that we don't make a mess of our existing database).  It doesn't really matter what you call the new database, but you'll probably want to make it meaningful.  For our example, let's go with <strong>mt4</strong>.  The default should be to have <strong>Structure and data</strong> and <strong>CREATE DATABASE before copying</strong> selected.  If not, select them now.  Then click <strong>Go</strong>.</p>

<p>Now you have a brand-spanking new copy of your database to play with.</p>

<p>Load up WinSCP - or whatever FTP program you have chosen - and connect to your FTP account.  The first thing you want to do is rename the existing blog directory (by default, <strong>blog-mt</strong>) to something else.  Again, it doesn't matter what you name it, but make it meaningful.  Let's go with blog-mt3 for now.  Then upload the contents of your new MT4 installation that you saved earlier to that location.  When it's done, you should have <em>two</em> MT directories - blog-mt (the new one) and blog-mt3 (the old one).</p>

<p>The reason we named the new one blog-mt is twofold.  First, Yahoo! seems to have some sort of hardcoded action going on in the background whereby if you name your new installation blog-mt4, it doesn't work right.  Second, by putting things into the same directory where they were to begin with, you don't have to rebuild anything right away - they just work.  That's why we had to rename the old directory, too - to get it out of the way.</p>

<p>Now we're almost done.  You need to copy the <strong>mt-config.cgi</strong> file from blog-mt3 to blog-mt.  But you'll want t make a few changes to it first.  In the default Small Business installation, the CGIPath directive is commented out.  You need to add it back in, otherwise it won't work right.  So do so now:</p>

<pre>CGIPath http://www.example.com/<strong>blog-mt</strong>/</pre>

<p>The section in bold (blog-mt) is the part that you'll set to the value of your own installation path, if it varies from blog-mt.</p>

<p>Next up, you need to change a few variables.  Scroll down until you see the database connection section.  You'll want to update the Database, DBUser and DBPassword directives:</p>

<pre>Database <strong>mt4</strong>
DBUser <strong>foo</strong>
DBPassword <strong>sRJSn4H1Fo7U0ZF7</strong></pre>

<p>Again, you will need to replace the values in bold with your own - the Database name with the value you used when you copied the database using phpMyAdmin and the DBUser and DBPassword with the username and password that were set up during the add administrator section of this tutorial.</p>

<p>Once you've made those changes and put the mt-config.cgi file into the new mt-blog directory, you are just about ready to go.  Make sure that at least the <strong>mt.cgi</strong> and <strong>mt-upgrade.cgi</strong> files are set to executable (755), and connect to mt.cgi to start the upgrade process.  You will also want to make sure that any other scripts you want to use are executable (mt-comments.cgi, mt-tb.cgi, etc).  But you don't need to do that until after the upgrade completes.</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/11/02/install_movable_type_4_in_yahoo_small_business.php">Don't Back Down</a> and LMT.</em></p>]]>
   </content>
</entry>

<entry>
   <title>Install Movable Type Under Windows (IIS)</title>
   <link rel="alternate" type="text/html" href="http://www.learningmovabletype.com/a/install_movable_type_under_windows_iis/" />
   <id>tag:www.learningmovabletype.com,2007://5.1923</id>
   
   <published>2007-11-02T14:48:33Z</published>
   <updated>2008-02-01T15:45:42Z</updated>
   
   <summary>Though the vast majority of installations I work with use LAMP (Linux, Apache, MySQL, Perl) to run Movable Type, there are also a few where my client would like to place Windows in that equation. While it&apos;s a possibility to run Apache on Windows, Internet Information Server (IIS) has shipped...</summary>
   <author>
      <name>Chad Everett</name>
      <uri>http://everitz.com/</uri>
   </author>
   
      <category term="Install" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="installingmt" label="Installing MT" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="windows" label="Windows" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.learningmovabletype.com/">
      <![CDATA[<p>Though the vast majority of installations I work with use LAMP (Linux, Apache, MySQL, Perl) to run <a href="http://www.sixapart.com/movabletype/">Movable Type</a>, there are also a few where my client would like to place Windows in that equation.  While it's a possibility to run Apache on Windows, Internet Information Server (IIS) has shipped with Windows Servers just about forever, and it's quite possible to get Movable Type up and running without Apache.  I guess you might like to call this a WIMP (Windows, IIS, MySQL, Perl) installation, which fits in nicely with the old Windows, Icon, Mice, Pointers joke from years back.  But I digress.</p>

<p>First, of course, you need Windows and IIS.  Unfortunately, configuring those two is going quite beyond the scope of this article.  Luckily, doing so is not particularly difficult.  You'll also need, at a minimum, <a href="http://dev.mysql.com/downloads/">MySQL</a> and <a href="http://www.activestate.com/store/activeperl/download/">Perl</a>.  If you want to use dynamic publishing, you'll also need <a href="http://www.php.net/downloads.php">PHP</a> - but I'm not going to cover that here.  Maybe next time.  Ready?  Let's go!</p>]]>
      <![CDATA[<p>I should probably cover a few questions.  First, MySQL and Perl.</p>

<p>MySQL is a database.  If you're familiar with <a href="http://www.microsoft.com/">Microsoft</a> products, then it's somewhat similar to Microsoft SQL Server - but it's free, and Movable Type stores all of its data inside.  There is a version of Movable Type that runs on SQL Server, and it's called the Enterprise version.  That's also not covered here.  This is for the standard product only, though some of the details might be of use to you.</p>

<p>When you go to get MySQL, you want the community version.  You can get the Enterprise version if you want, but it's not needed.  From the link above, download the <strong>MySQL Community Server</strong>.  The Enterprise version should work, but you'll have to buy it one day (the Enterprise version is not free software).  You should also download the <a href="http://dev.mysql.com/downloads/gui-tools/index.html">MySQL GUI Tools</a>.  These aren't strictly required, but if you're used to Windows, chances are you like working in Windows, not at the command line, so it's nice to have them available.</p>

<p><strong>Perl</strong> is a programming language.  Specifically, it is the language that Movable Type is written in, and in order to run Movable Type, you must have Perl.  The link above takes you to the download location.  You don't even have to provide your contact details, but you can if you like.</p>

<p>Once you get both MySQL and Perl installed (the installation is fairly straightforward for Windows applications), you're ready to proceed.  Also install the GUI tools if you downloaded them.  Download your Movable Type installation and unpack it to a directory where you'll store it.  Generally this will be called something easy to remember, like <strong>mt</strong>, and can be found inside your <strong>wwwroot</strong> directory, along with your other website files.</p>

<p>You will likely need to install two <em>modules</em> before Movable Type will work.  This process is started from the command line.  Click <strong>Start</strong>, then <strong>Run</strong>, then enter <strong>CMD</strong> and press <strong>ENTER</strong>.  At the command line, type <strong>ppm</strong> (unlike most *nix systems, Windows is not case-sensitive, so you can actually type ppm, PPM or even PpM and it should work fine) and press <strong>ENTER</strong>. This starts a graphical installation utility.</p>

<p>The process will take a moment to synchronize the database.  When it is done, you will be presented with a list of all installed modules.  Click the <strong>View</strong> menu item, then select <strong>All Packages</strong>.  In the search box, enter <strong>dbd-mysql</strong> (case is not important).</p>

<p>You should see three packages listed - DBD-mysql, DBD-mysql-SimpleMySQL and DBD-mysqlPP.  Next to each are three columns: <em>area</em>, <em>installed</em> and <em>available</em>.  We want to see if DBD-mysql is installed.  It probably is not.  Click the row that contains DBD-mysql to highlight it, then click the box with a plus on it, next to the search box.  This marks it for installation.</p>

<p>Next, click in the search box and search for <strong>mail-sendmail</strong>.  Like DBD-mysql, it is probably not installed.    Again, click the row to highlight it and then click the box with a plus on it to mark it for installation.</p>

<p>Now we just need to install the modules that were not installed.  Click the <strong>File</strong> menu option, and select <strong>Run Marked Actions</strong>.  This will install those items you have marked.  If everything goes as planned, you will now have two new modules installed!  If not, try these steps again to see if you can get them to work.  If it doesn't you may need some help that can't be addressed here.</p>

<p>Once the modules have been installed, you're done here.  You can exit ppm and close the command-line window.</p>

<p>Open the <strong>MySQL Query Browser</strong> by going to <strong>Start</strong>, then <strong>MySQL</strong>, then selecting MySQL Query Browser.  You'll be prompted for a login.  Specify the user name and password that you gave when installing MySQL earlier.  You will also need to provide a default schema.  This is simply the default database that you'll be using.  Enter <strong>mysql</strong> for now.  So long as it's valid, it doesn't really matter what you specify here.</p>

<p>Once connected, you need to create your new database.  We'll call it <strong>mt</strong>.  In the query window (at the top), enter <strong>create database mt;</strong> (note the semicolon at the end) and click the <strong>Execute</strong> button.  This creates the database for you.  You can now exit the MySQL Query Browser.</p>

<span class="mt-enclosure mt-enclosure-image"><a href="http://www.learningmovabletype.com/2007/mysql-create-database.php" onclick="window.open('http://www.learningmovabletype.com/2007/mysql-create-database.php','popup','width=539,height=52,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.learningmovabletype.com/2007/mysql-create-database-thumb-135x13.png" width="135" height="13" alt="mysql-create-database.png" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></a></span>

<p>With the applications configured and the database ready to go, there are only a few items left.  First up is updating the Movable Type configuration file.  For this, you need to locate the file, which you will find in the <strong>mt</strong> directory that you created earlier.  The name of the file is <strong>mt-config.cgi-original</strong>.  Before doing anything, copy this file to another name - <strong>mt-config.cgi</strong> (drop the -original from the end).  Then edit this new file.</p>

<p>The first line in the file to edit is the <strong>CGIPath</strong> declaration.  This indicates where Movable Type is found, and should be either a full URL or a relative URL (without the domain).  Most Windows systems don't use a cgi-bin, so the example is probably not going to be correct.  That doesn't stop you from using one, but you don't need one either.  Here's the example, simply make the necessary changes to what it will need to be once the site is live:</p>

<pre>CGIPath http://www.example.com/cgi-bin/mt/</pre>

<p>The next line to configure is the <strong>StaticWebPath</strong> directive.  Because Windows systems rarely use the cgi-bin, and if they do, it's not restricted like it is on *nix systems, the use of this is often simply commented out (just put a # sign in the front).  You can use it, but for simplicity, I won't address it here.  Your should look like this:</p>

<pre>#StaticWebPath http://www.example.com/mt-static</pre>

<p>Now you need to configure your database.  This actually requires five values.  The first will not change with this configuration - we are always using DBI::mysql.  The second is going to be the name of the database that we created above (we used mt, if you use something else, replace it here).  The third is the username you created when you set up MySQL and the fourth is the password for that user.  The last value is the host - localhost since the database is on the same computer as the site.  If you move the database, this would point to that location.</p>

<pre>ObjectDriver DBI::mysql
Database mt
DBUser DATABASE_USERNAME
DBPassword DATABASE_PASSWORD
DBHost localhost</pre>

<p>The final step is actually an optional one, and that is if you want to send notifications.  To do this on Windows, we must use SMTP (actually, there are other ways, but this is by far the easiest).  Simply specify two more directives in the file:</p>

<pre>MailTransfer smtp
SMTPServer localhost</pre>

<p>If for any reason the SMTP server is not running on the local computer (for instance, if it's another system), just specify that value instead.</p>

<p>Now, save the mt-config.cgi file.</p>

<p>Almost there - start your <strong>IIS Manager</strong>.  Usually this is done by going to <strong>Administrative Tools</strong> and then selecting <strong>Internet Information Services (IIS) Manager</strong>, but you may have a shortcut on the desktop or in the quick launch bar.  However you get there is fine.  Open the web site where Movable Type will run, whether it is the Default Web Site or another one.</p>

<p>Expand the web site and locate the mt directory.  Right-click on the mt directory and select <strong>Properties</strong>.  Click the <strong>Configuration</strong> button.  In the <strong>Application Extensions</strong> list, scroll down until you reach <strong>cgi</strong> (it should be between cer and config).  It may not be there at all.  If you don't see it, you'll need to add it.  If it is there, you'll need to edit it.  In other words, if you don't see it, click <strong>Add</strong>.  If you do see it, highlight it and click <strong>Edit</strong>.  You want to make the extension look like this mapping.</p>

<span class="mt-enclosure mt-enclosure-image"><a href="http://www.learningmovabletype.com/iis-application-extension-mapping.php" onclick="window.open('http://www.learningmovabletype.com/iis-application-extension-mapping.php','popup','width=428,height=242,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.learningmovabletype.com/2007/iis-application-extension-mapping-thumb-106x59.png" width="106" height="59" alt="iis-application-extension-mapping.png" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /></a></span>

<p>That means you need to specify the path to the executable - which should be <strong>C:\Perl\bin\perlis.dll</strong>, the verbs, which are limited to <strong>GET,HEAD,POST</strong> and check both boxes.  There are some references that you should map the cgi extension to the Perl executable rather than the dll.  However, there are two reasons why I would suggest that you don't do this.  First, the performance with the dll is better.  Second, MT4 does not work with the executable.  I can't tell you why, as I have been unable to figure it out - but it works with the dll version whenever I've tried.  Add to that improved performance, and I'd stick with the dll.</p>

<p>Click, OK to save the mapping, OK to save the Configuration and OK to apply the properties.  Almost done.</p>

<p>Scroll all the way to the bottom of the IIS Manager window (left side).  You'll see an item called <strong>Web Service Extensions</strong>.  Click it.  On the right side, it will list two items for Perl - one for <strong>Perl CGI Extension</strong> and one for <strong>Perl ISAPI Extension</strong>.  The first is if you decide to use the executable version of Perl.  The second is if you use the dll version.  Since we're using the dll version, we're using the second.  But if you've gone with the executable, you want the first.  Keep that in mind.</p>

<p>Since we want the second, click the second (that would be Perl ISAPI Extension) and then click <strong>Allow</strong>.  That's it.  Now stop and start your web site, just to make sure that it picks up all the changes that you've made.</p>

<p>To test out your configuration, visit the <strong>mt-check.cgi</strong> page by loading it in a browser.  This will be at the CGIPath location you set earlier, along with mt-check.cgi at the end.  So it should look something like this:</p>

<pre>http://www.example.com/cgi-bin/mt/mt-check.cgi</pre>

<p>If everything works as expected, then all the checks should work.  You will get a few that will fail, but you'll have enough that you can run the installation.  Just remove the <strong>-check</strong> (that is, connect to mt.cgi) and you'll be prompted to run the installation procedure.</p>

<p>There's a lot of detail here, but mostly that's to make sure that everything is covered.  Read it over and try it out - you'll realize that it's really not that complex.</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/10/26/install_movable_type_under_windows_iis.php">Don't Back Down</a> and LMT.</em></p>]]>
   </content>
</entry>

<entry>
   <title>Upgrading to Movable Type 4 with MTCommentFields</title>
   <link rel="alternate" type="text/html" href="http://www.learningmovabletype.com/a/upgrading_to_movable_type_4_with_mtcommentfields/" />
   <id>tag:www.learningmovabletype.com,2007://5.1910</id>
   
   <published>2007-10-26T17:06:40Z</published>
   <updated>2008-02-01T15:45:31Z</updated>
   
   <summary>By now, there&apos;s a reasonable chance that if you&apos;ve wanted to upgrade to the latest release of Movable Type, you&apos;ve done so. But you may still be waiting. Perhaps you&apos;re hoping that your favorite plugin will be updated (there are still a few that haven&apos;t been released for MT4). Or...</summary>
   <author>
      <name>Chad Everett</name>
      <uri>http://everitz.com/</uri>
   </author>
   
   <category term="comments" label="Comments" scheme="http://www.sixapart.com/ns/types#tag" />
   <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://www.learningmovabletype.com/">
      <![CDATA[<p>By now, there's a reasonable chance that if you've wanted to upgrade to the latest release of <a href="http://www.sixapart.com/movabletype/">Movable Type</a>, you've done so.  But you may still be waiting.  Perhaps you're hoping that your favorite plugin will be updated (there are still a few that haven't been released for MT4).  Or maybe you've run into a problem that you can't seem to overcome.</p>

<p>One of the issues that I run into fairly regularly is for people who use the <strong>MTCommentFields</strong> tag.  This tag, originally released in version 3.0D - way back in 2004, for those of you keeping track - was designed so that you wouldn't have to keep up with your comment form.  Unfortunately, people like to keep up with their comment form, to move it around, change some wording, add features or just tinker.  So it rapidly fell out of favor, and in MT4, it's gone completely.</p>

<p>If you're still using it and you want to upgrade, you'll see a message that reads <em>The MTCommentFields tag is no longer available; please include the Comment Form template module instead</em>.  You will be able to rebuild your templates, but you won't be able to accept any new ones.</p>

<p>And naturally, if you're upgrading, you won't have this module to make that happen.  To make matters worse, if you're a user of certain versions, even if you try and get rid of the tag, you might <em>still</em> have problems.  What do you do?  Luckily, it's an easy fix.</p>]]>
      <![CDATA[<p>To fix this problem, you need to first make two changes to your <strong>Individual Entry Archive</strong> template.  Users who first created this template in a version of Movable Type from v3.0D to 3.17 will have to make three changes.  Ready?  Here we go.</p>

<p>First, click on <strong>Design</strong>, then <strong>Archive Templates</strong>.  You are looking for the <strong>Individual Entry Archive</strong> template.  Near the top, locate the JavaScript in the template.  It will look something like this:</p>

<pre>&lt;script type="text/javascript" language="javascript">
&lt;!--
var HOST = \'&lt;$MTBlogHost$>\';
// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.
function setCookie (name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) + (expires ? "; expires=" + expires : "") + (path ? "; path=" + path : "") + (domain ? "; domain=" + domain : "") + (secure ? "secure" : "");
    document.cookie = curCookie;
}
function getCookie (name) {
    var prefix = name + \'=\';
    var c = document.cookie;
    var nullstring = \'\';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}
function deleteCookie (name, path, domain) {
    if (getCookie(name))
        document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
function fixDate (date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0)
        date.setTime(date.getTime() - skew);
}
function rememberMe (f) {
    var now = new Date();
    fixDate(now);
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    if (f.author != undefined)
       setCookie(\'mtcmtauth\', f.author.value, now, \'/\', HOST, \'\');
    if (f.email != undefined)
       setCookie(\'mtcmtmail\', f.email.value, now, \'/\', HOST, \'\');
    if (f.url != undefined)
       setCookie(\'mtcmthome\', f.url.value, now, \'/\', HOST, \'\');
}
function forgetMe (f) {
    deleteCookie(\'mtcmtmail\', \'\', HOST);
    deleteCookie(\'mtcmthome\', \'\', HOST);
    deleteCookie(\'mtcmtauth\', \'\', HOST);
    f.email.value = \'\';
    f.author.value = \'\';
    f.url.value = \'\';
}
//-->
&lt;/script></pre>

<p>You want to remove this entire block and change it to this:</p>

<pre>&lt;script type="text/javascript" src="&lt;$MTLink template="<strong>javascript</strong>"$>">&lt;/script></pre>

<p>Various versions of the software would create a <strong>Site JavaScript</strong> file for you.  If you view your template listing (index templates) and see a file with a name of Site JavaScript, you'll enter <strong>site javascript</strong> here.  If you see a file with a name of JavaScript, enter <strong>javascript</strong> here.  Case is not important.</p>

<p>This allows Movable Type to pull the name of another template - in this case the JavaScript (or Site JavaScript) - and fill in the blank.  This is a much better solution than hardcoding the name, because people have a tendency to tinker with names, and what though a lot of people don't change the name, some might, so this covers most bases.  If you change the name, just make sure you change this value.</p>

<p>If for any reason you don't have the JavaScript (or Site JavaScript) template, you can find a new one by looking in the default_templates directory if your Movable Type distribution.  In fact, this isn't a bad idea, as new content is periodically added to this file, so you may gain some new functionality by updating this file from time to time as new versions are released.</p>

<p>Next, you need to scroll down and locate the MTCommentFields tag.  By default, it is located slightly down the screen, between two tags for <strong>MTIfCommentsAllowed</strong>:</p>

<pre>&lt;MTIfCommentsAllowed>
&lt;MTCommentsFields>
&lt;/MTIfCommentsAllowed></pre>

<p>You can simply delete it - but if you do, you need to replace it with something (unless you don't plan on accepting comments, in which case you can save it and you're done).</p>

<p>If you do want to accept comments, then the simplest change is to alter the tag by changing all three lines to an <strong>MTInclude</strong> statement, which includes the aforementioned Comment Form.  Don't worry about the form itself that you need to include right now - we'll create that in a moment.  Here is what it should look like:</p>

<pre>&lt;$MTInclude module="Comment Form"$></pre>

<p>Remember, replace all three lines with this one.  It won't really hurt to leave the outer MTIfCommentsAllowed statements there, but you don't need them, and you're just making more work for the template, because the Comment Form template handles that for you.</p>

<p>Before you save the template, however, you may have one more change to make.  So scroll down to the bottom and look for these lines:</p>

<pre>&lt;script type="text/javascript" language="javascript">
&lt;!--
if (document.comments_form.email != undefined)
    document.comments_form.email.value = getCookie("mtcmtmail");
if (document.comments_form.author != undefined)
    document.comments_form.author.value = getCookie("mtcmtauth");
if (document.comments_form.url != undefined)
    document.comments_form.url.value = getCookie("mtcmthome");
if (getCookie("mtcmtauth") || getCookie("mtcmthome")) {
    document.comments_form.bakecookie[0].checked = true;
} else {
    document.comments_form.bakecookie[1].checked = true;
}
//-->
&lt;/script></pre>

<p>Present in the default template from version%</p>]]>
   </content>
</entry>

<entry>
   <title>How to Fix a Common MT4 Feed Formatting Error</title>
   <link rel="alternate" type="text/html" href="http://www.learningmovabletype.com/a/how_to_fix_a_co/" />
   <id>tag:www.learningmovabletype.com,2007://5.1810</id>
   
   <published>2007-10-05T17:25:10Z</published>
   <updated>2008-02-01T15:45:05Z</updated>
   
   <summary>Over the last few years, the term beta has been somewhat misused. It used to be that when you used beta software, you expected to encounter problems. But when Google started throwing around the term for its offerings, people came to expect that beta software wasn&apos;t so bad. Still need...</summary>
   <author>
      <name>Chad Everett</name>
      <uri>http://everitz.com/</uri>
   </author>
   
      <category term="Feeds" scheme="http://www.sixapart.com/ns/types#category" />
   
      <category term="Templates" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="feeds" label="Feeds" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="mt4" label="MT4" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.learningmovabletype.com/">
      <![CDATA[<p>Over the last few years, the term <em>beta</em> has been somewhat misused.  It used to be that when you used beta software, you expected to encounter problems.  But when <a href="http://www.google.com/">Google</a> started throwing around the term for its offerings, people came to expect that beta software wasn't so bad.  Still need an example?  Despite <a href="http://www.gmail.com/">Gmail</a> arguably being the leader in web-based email systems, it's had that tag for more than two years.</p>

<p>There are plenty of examples, but hopefully you get the point I'm trying to make - that beta just doesn't mean what it used to.  So there really shouldn't be a surprise that people install beta software.  It used to be that only a certain crowd would install beta software, but these days, just about everyone will do so, thinking that they can expect to get what they have come to expect.  That's not always the case, as sometimes you can get nasty surprises.</p>]]>
      <![CDATA[<p>One of those surprises comes in the form of a malformed feed in MT4.  Take a look at this screenshot (thanks <a href="http://www.appnel.com/">Tim</a> for letting me use you for this exercise!).</p>

<span class="mt-enclosure mt-enclosure-image"><a href="http://www.learningmovabletype.com/2007/appnel-feed.php" onclick="window.open('http://www.learningmovabletype.com/2007/appnel-feed.php','popup','width=739,height=387,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.learningmovabletype.com/2007/appnel-feed-thumb-185x96.png" width="185" height="96" alt="appnel-feed.png" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></a></span>

<p>You may notice that there is absolutely no formatting within.  Luckily, there is also a very easy fix for the problem.  But first, a small explanation of exactly what is happening.</p>

<p>When MT 4.01 was released, the release notes said that a bug (#56367 for those keeping track) had been fixed.  We were told that the formatting for <strong>Markdown</strong> was not processing correctly in feeds.  In actuality, this isn't really accurate.</p>

<p>The problem doesn't have anything specifically to do with Markdown - it has to do instead with the fact that in an earlier beta of MT4 distributed feeds with the wrong attribute on the MTEntryBody and MTEntryMore tags.  It may look like any of these:</p>

<pre>&lt;$MTEntryBody encode_xml="1" convert_breaks="0"$><br />
&lt;$MTEntryMore encode_xml="1" convert_breaks="0"$></pre>

<pre>&lt;$MTEntryBody encode_xml="1" convert_linebreaks="1"$><br />
&lt;$MTEntryMore encode_xml="1" convert_linebreaks="1"$></pre>

<p>What is happening is that the <strong>convert</strong> attribute - whichever one you are using - will override your text filter (perhaps Markdown, as Tim was using in the screenshot above) and you will end up with garbage.  To correct the problem, simply load up your feed templates and change the lines to this:</p>

<pre>&lt;$MTEntryBody encode_xml="1"$><br />
&lt;$MTEntryMore encode_xml="1"$></pre>

<p>You may need to do a bit of digging, because if you are using something like the <a href="http://www.learningmovabletype.com/a/continue_reading_feed_link/">Continue Reading</a> link, the fields might not be right next to each other.  Also, make sure that you check for both Atom and RSS templates, because both will be affected by this "bug".</p>

<p>If the first version of MT that you installed was after MT4 and prior to 4.01RC2, then you may be affected by this, so check your templates.  If you upgraded your blog from a previous MT release, then you should be fine - as long as you don't create a new blog using the default templates before you upgrade to MT 4.01.  Finally, if you haven't upgraded to MT 4.01, you should do so now!</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/10/05/how_to_fix_a_common_mt4_feed_formatting_error.php">Don't Back Down</a> and LMT.</em></p>]]>
   </content>
</entry>

<entry>
   <title>Understanding the Category Listing Code</title>
   <link rel="alternate" type="text/html" href="http://www.learningmovabletype.com/a/001432understanding_category_listing/" />
   <id>tag:www.elise.com,2005:/mt//10.1432</id>
   
   <published>2005-09-20T17:13:24Z</published>
   <updated>2007-10-26T17:05:40Z</updated>
   
   <summary> This tutorial is co-authored by LMT contributor Chad Everett of Everitz Consulting and Elise Bauer of elise.com. Movable Type allows you to create categories and sub-categories for organizing your entries. The default MT3.2 Main Index template includes code to list these categories in the sidebar section. This tutorial will...</summary>
   <author>
      <name>Chad Everett</name>
      <uri>http://everitz.com/</uri>
   </author>
   
      <category term="Categories" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="categories" label="Categories" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="subcategories" label="Subcategories" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.learningmovabletype.com/">
      <![CDATA[<p><img alt="mtbadge-small.gif" src="http://www.learningmovabletype.com/images/mtbadge-small.gif" width="50" height="50" class="floatimgleft" /> <em>This tutorial is co-authored by LMT contributor Chad Everett of <a href="http://everitz.com">Everitz Consulting</a> and Elise Bauer of <a href="http://www.elise.com">elise.com</a>.</em></p>

<p>Movable Type allows you to create categories and sub-categories for organizing your entries.  The default MT3.2 Main Index template includes code to list these categories in the sidebar section.  This tutorial will attempt to explain the tags used in this code and how they work together.</p>

<h3>Categories, Sub-categories, Parent, Child, and Levels</h3>

<p>The only difference between a category and a sub-category is that the latter will always have a "parent" category.  The sub-category is still a category, and everything else remains the same as any other category.  But by having sub-categories, you can provide better organization for your site.  One example might be to put sub-categories of "Movable Type" and "Typepad" under a parent category of "Tips", to better classify the information you are creating.</p>

<p>Any category with such a "parent" will be considered a "child".  Additionally, any category (even a sub-category!) can have its own children as well.  Because of this, within this tutorial, you will see the term "level" used frequently.  A parent category (Tips) is on one level.  The child category (Movable Type, Typepad) is another.  In turn, the child category may have children itself (Plugins, Styles, Templates), creating still another level.</p>
]]>
      <![CDATA[<h3>The Default Category Listing Code</h3>

<p>Here is the code from the Main Index template:</p>

<pre><code>&lt;MTTopLevelCategories&gt;
&lt;MTSubCatIsFirst&gt;&lt;ul&gt;&lt;/MTSubCatIsFirst&gt;
&lt;MTIfNonZero tag="MTCategoryCount"&gt;
&lt;li&gt;&lt;a href="&lt;$MTCategoryArchiveLink$&gt;"
title="&lt;$MTCategoryDescription$&gt;"&gt;&lt;MTCategoryLabel&gt;&lt;/a&gt;
&lt;MTElse&gt;
&lt;li&gt;&lt;MTCategoryLabel&gt;
&lt;/MTElse&gt;
&lt;/MTIfNonZero&gt;
&lt;MTSubCatsRecurse&gt;
&lt;/li&gt;
&lt;MTSubCatIsLast&gt;&lt;/ul&gt;&lt;/MTSubCatIsLast&gt;
&lt;/MTTopLevelCategories&gt;
</code></pre>

<p><b>&lt;MTTopLevelCategories&gt;</b>
<code>&lt;MTTopLevelCategories&gt;</code> is a container that processes the code within, starting with the current highest level category.  When it gets to the <code>&lt;MTSubCatRecurse&gt;</code> tag, it then repeats the process with the next highest level of category, and so on, through all levels of sub-categories.</p>

<p><b>&lt;MTSubCatIsFirst&gt;
&lt;MTSubCatIsLast&gt;</b>
These tags simply indicate if a particular category is the first in the list or the last in the list, respectively.  As you can see these tags open the <code>&lt;ul&gt;</code>  and then close the <code>&lt;ul&gt;</code> at the end of this section of code.  So, the first category in the list of categories opens the unordered list tag - <code>&lt;ul&gt;</code> - which pulls from your stylesheet the direction of how to display an unordered list. (Unordered lists are usually displayed with bullet points.  Ordered lists - <code>&lt;ol&gt;</code> - are usually displayed numbered 1, 2, 3, etc.)  Likewise, the last category in the list of categories closes the unordered list tag.</p>

<p><b>&lt;MTIfNonZero&gt;</b>, <b>MTCategoryCount</b> and <b>&lt;MTElse&gt;</b>
The <code>&lt;MTIfNonZero&gt;</code> tag compares the value of the tag (in this case, MTCategoryCount) to zero. If there are entries within a category, the MTCategoryCount will be greater than zero and a link will be provided to the category page. If the there are no entries in the category, the MTCategoryCount will equal zero and <code>&lt;MTElse&gt;</code> will come into play and only the category label will be shown, without a link.  </p>

<p>In either case, an <code>&lt;li&gt;</code> tag is opened which instructs the browser that what comes next is a list item.  The <code>&lt;li&gt;</code> tag is closed after the processing of the <code>&lt;MTSubCatsRecurse&gt;</code> is complete.</p>

<p><b>&lt;MTSubCatsRecurse&gt; </b>
This tag says to process this hunk of code for each level of sub-categories under this one (and so on).</p>

<p>"Recurse", by the way, is a programming term, indicating to "use recursion".  In other words, it is the ability of the routine - in this case the &lt;MTTopLevelCategories&gt; container - to call itself over and over again.</p>

<p>In this example it means that the container will continue to loop through each "level" of categories, until it reaches the end of that level.  At this point, if on a "lower" level (that is, a sub-category), processing will return to the next higher level (the "parent"), where the loop will complete.  If the loop is still on a lower level, it will end that loop, and return up to the next level.  And so on.</p>

<p>If you remove this tag, the code will produce the same structure - but it will only be for the top-level categories (no sub-categories).  If you include this tag, each time through the loop (that is, for each current category), it will redo the structure for the categories below that one.  You can perhaps see this best by looking at the HTML. </p>

<p>For top-level categories only (no recurse tag, meaning no sub-categories at all), you might see something like:</p>

<pre><code>&lt;ul&gt;
  &lt;li&gt;News&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>But with the recurse tag, you will be able to produce something like this:</p>

<pre><code>&lt;ul&gt;
  &lt;li&gt;News
  &lt;ul&gt;
    &lt;li&gt;Local&lt;/li&gt;
    &lt;li&gt;World&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>To explain how this works...</p>

<p>First, the opening <code>&lt;ul&gt;</code>, then the first category (the only one in this sample).  Prior to that tag being closed, the recurse tag runs - and realizes there are some sub-categories for the current category.</p>

<p>So it opens a new <code>&lt;ul&gt;</code> for this level of sub-categories, which in turn has its own items in the list.  When that category is at the end, it closes that list with <code>&lt;&#47;ul&gt;</code>, then closes that item (News) with <code> &lt;&#47;li&gt;</code>.  Finally, we're at the end of the entire category list, so the top-level list is closed with <code>&lt;&#47;ul&gt;</code>.</p>

<p>This illustrates a more likely example, with multiple categories at each level:</p>

<pre><code>&lt;ul&gt;
  &lt;li&gt;News
  &lt;ul&gt;
    &lt;li&gt;Local&lt;/li&gt;
    &lt;li&gt;World&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Recipes
  &lt;ul&gt;
    &lt;li&gt;Beef&lt;/li&gt;
    &lt;li&gt;Chicken&lt;/li&gt;
    &lt;li&gt;Pork&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Tips
  &lt;ul&gt;
    &lt;li&gt;Movable Type
    &lt;ul&gt;
      &lt;li&gt;Plugins&lt;/li&gt;
      &lt;li&gt;Styles&lt;/li&gt;
      &lt;li&gt;Templates&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;Typepad&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>You'll notice that under "Tips", the recurse tag pulls up "Movable Type", similar to how "News" worked earlier.  But when this category is the "current" category, it will again pull up the recurse tag, now at the next "level" down in the category listing.  This next level down generates the list for those sub-categories: "Plugins", "Styles" and "Templates".  The structure is all the same - pulled from the top-level.  It just runs it over and over again as needed for all of the sub-categories.  </p>

<h3>Customizing the Category Listing</h3>

<p><b>Not Showing Categories without Entries</b>
The default code will display the name of all of your categories, whether or not you have entries in them.  If you want to display only those categories which currently have entries, you need to remove the <code>&lt;MTElse&gt;</code> condition from the equation.  Your resulting code would be something like this:</p>

<pre><code>&lt;MTTopLevelCategories&gt;
&lt;MTSubCatIsFirst&gt;    &lt;ul&gt;    &lt;/MTSubCatIsFirst&gt;
&lt;MTIfNonZero tag="MTCategoryCount"&gt;
&lt;li&gt;&lt;a href="&lt;$MTCategoryArchiveLink$&gt;" title="&lt;$MTCategoryDescription$&gt;"&gt;&lt;MTCategoryLabel&gt;&lt;/a&gt;
&lt;/MTIfNonZero&gt;
&lt;MTSubCatsRecurse&gt;
&lt;/li&gt;
&lt;MTSubCatIsLast&gt;    &lt;/ul&gt;    &lt;/MTSubCatIsLast&gt;
&lt;/MTTopLevelCategories&gt;
</code></pre>

<p>Note that if you have a top level category that is empty, but contains sub-categories that have items, removing this piece of code will create an unusual display as those sub-categories will be placed in the same list as the prior category.  This is because the <code>&lt;MTCategoryCount&gt;</code> tag doesn't include the count of sub-category items beneath the current category.</p>

<p>If you use sub-categories and you do not want to show sub-categories or top level categories unless they contain items, one method you can use is to install the <a href="http://www.everitz.com/sol/subcatcount/index.html">SubCatCount</a> plugin.  With this plugin installed, your code would look like this:</p>

<pre><code>&lt;MTTopLevelCategories&gt;
&lt;MTSubCatIsFirst&gt;    &lt;ul&gt;    &lt;/MTSubCatIsFirst&gt;
&lt;MTIfNonZero tag="MTSubCatCount"&gt;
&lt;li&gt;    &lt;a href="&lt;$MTCategoryArchiveLink$&gt;" title="&lt;$MTCategoryDescription$&gt;"&gt; &lt;MTCategoryLabel&gt; &lt;/a&gt;
&lt;MTElse&gt;
&lt;li&gt;    &lt;MTCategoryLabel&gt;
&lt;/MTElse&gt;
&lt;/MTIfNonZero&gt;
&lt;MTSubCatsRecurse&gt;
&lt;/li&gt;
&lt;MTSubCatIsLast&gt;    &lt;/ul&gt;    &lt;/MTSubCatIsLast&gt;
&lt;/MTTopLevelCategories&gt;
</code></pre>

<p><b>Limiting the levels of sub-categories displayed</b></p>

<p>If you have several levels of sub-categories, you may want to limit the display of them in your Category List to only a few levels.  To do this add a <code>max_depth</code> attribute to the recurse tag like so:</p>

<pre><code>&lt;MTSubCatsRecurse max_depth="3"&gt;
</code></pre>

<p><b>Not Showing sub-categories</b></p>

<p>To show only primary categories, and not sub-categories in your listing, remove the <code>&lt;MTSubCatsRecurse&gt;</code> tag from the code entirely.  This is not the same as <code>max_depth="1"</code>.  That will include the top-level categories <em>and</em> the first level of sub-categories.</p>

<p><b>Adding an Entry Count</b></p>

<p>To add the the number of entries in parentheses after each category or sub-category label, you would use the &lt;MTCategoryCount&gt; template tag.  Something like this displays the added code at the end of the link to the category archive page:</p>

<pre><code>&lt;li&gt;&lt;a href="&lt;$MTCategoryArchiveLink$&gt;" title="&lt;$MTCategoryDescription$&gt;"&gt;&lt;MTCategoryLabel&gt;&lt;/a&gt; (&lt;MTCategoryCount&gt;)
</code></pre>

<p>If you wanted to instead display the sub-category count at that point, you should use &lt;MTSubCatCount&gt; instead of &lt;MTCategoryCount&gt;, as mentioned previously, by installing the <a href="http://www.everitz.com/sol/subcatcount/index.html">SubCatCount</a> plugin.</p>

<p><b>Displaying Categories in a Custom Order</b></p>

<p>This tip comes in from an LMT reader.  To come up with your own custom order of categories or subcategories, without the use of a plugin, do the following:</p>

<p>a.  Name the categories 1, 2, 3 ...  in the order you want them to appear.
b.  Use the <code>description</code> field for the name of the category.
c.  Replace <code>MTCategoryLabel</code> with <code>MTCategoryDescription</code> in your category display code.</p>

<p><em>Many thanks to Hugo Paulissen for this last tip.</em></p>
]]>
   </content>
</entry>

</feed>

