Subscribe: Learning Movable Type
http://feeds.feedburner.com/LMT
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
authors  blog  click  code  css  don  file  list  make  movable  new  run  select  site  tasks  template  version  work 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Learning Movable Type

Learning Movable Type



Tutorials and helpful tips for the Movable Type web publishing system



Last Build Date: Mon, 20 Jun 2011 12:51:36 -0800

Copyright: Copyright 2011
 



Learning Movable Type is Up Again!

Mon, 20 Jun 2011 12:51:36 -0800

It has been a while, but Learning Movable Type is finally alive again!  Many thanks to site founder Elise Bauer who has graciously passed me the torch.  You might know me from my other MT-related site and from the (almost) six years I spent working at Six Apart Europe, where I did (among other things) the support for all European Movable Type users.  So what is the plan with this site?

Learning Movable Type has always been and will remain a place to learn about using Movable Type, with (hopefully) contributions from the community.  So if you are interested in writing for this site, let me know.  (You can even have your own adsense code on your own entries, Elise tells me.)

Personally, I plan on having a look at the older entries on this site with an eye towards bringing them up to date or expanding them for use with more recent versions of Movable Type (or even Melody).  But more about that in the coming days.

Anyway, here's to a second life for 'Learning Movable Type'!  Got any suggestions?  Blow the dust off the old comment form below and let me know!




Create a Custom Feed Reader with Blogger Blog List

Fri, 27 Jun 2008 15:54:10 -0800

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 another blogging platform, you can make use of this Blogger feature to pull feeds into your blog. Here's what it looks like on my site - Simply Recipes: Food Blog Updates: Which is driven off of this Blogspot page: http://foodbloglinks.blogspot.com/. It's very easy to set up. Here are the steps in detail: 1. Create a Blogger Blog. If you don't already have a Blogger account, get one for free at http://blogger.com. 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". 2. Add blogs to your Blog List. 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". 3. Strip the Blogger blog layout of everything that isn't necessary. 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. 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. Remove the Blogger nav bar by adding the following code to the CSS (in the footer section): #navbar { display: none; } Click "SAVE TEMPLATE". Now click on "Page Elements". It should look like this: If you click on "View Blog" you should see something like this: 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. For example, #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; } You can also change the default text colors and styles in the variable name section at the top of the Edit HTML template. Review your published blog and take note of the URL. 4. Use an iframe tag to pull the Blogger blog into your regular blog. 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: src="http://yourfeedblog.blogspot.com/" width="630" height="2000" frameborder="0"> 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. Save and publish. That's it! As you add more blogs to your Blog List, you may need to increase the height of the iframe. [...]



MultiBlog and Upgrading to MT4

Sun, 08 Jun 2008 11:46:45 -0800

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:

"Publish error in template 'Main Index': No handler exists for tag MultiBlogEntries"

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.

So and become and .




Get An Email List of All Authors On Your System

Thu, 13 Mar 2008 10:27:56 -0800

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 email client. It’s particularly useful on larger installs:


    
        "" 
        <>,
    

And the Authors tag allows for all sorts of cool filtering attributes so you can get at any group of authors in the system, ordered however you like:

  • display_name: Specifies a particular author to select.
  • lastn: Limits the selection of authors to the specified number.
  • sortby: Supported values: displayname, name, created_on.
  • sort_order: Supported values: ascend, descend.
  • roles: comma separated list of values. eg “Author, Commenter”
  • need_entry: 1 | 0 (default is 1)
  • status: Supported values: enabled, disabled. Default is enabled.

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

 "" <>, 
 

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.

Just make sure you use this for good, not evil.




Upgrading to MT4

Sat, 16 Feb 2008 00:02:04 -0800

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 still hold for safely upgrading to MT4 (from MT3) are:

  1. Make a back up of your database.
  2. Make sure all the plugins you use for your site have upgrades that are compatible with the new version.
  3. Install MT into a new directory in your cgi-bin. Do NOT overwrite your existing MT directory.

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 Community Generated Upgrade Guide.

Please see the instructions at the Community Wiki for the specific details on how to safely upgrade your MT blog to MT version 4.




Creating a Google Toolbar Button for Your Blog

Fri, 15 Feb 2008 22:28:02 -0800

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. I recently updated my Google toolbar for Simply Recipes and created a new one for a new site, Food Blog Search. (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. Step 1: Install Google Toolbar The Google Toolbar requires using either IE or Firefox for your browser. Go to this page at Google to install it. Step 2: Create an Icon for Your Toolbar Button 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 How to make good looking icons.) You will need to display this graphic as code in the next step. To do that, go to this site. 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. Here is the encoded output for this icon example : R0lGODlhEAAQAOYAAAAAAP///4AZG3sYGYkcHZUfIaEiJJwhIrcoKaYkJsYsLcYsLsMrLcIrLMIr LbspLLYoKtEvMMwuL8wuMMotL8ktLsktL8gtLsctL8UsLcQsLcQsLsMsLcErLMArLM8vMMsuL8Yt LsIsLVEMD1MOEWsUF3oYG3AWGo8dIIwdIqEiJSsEBhMCA1gOEoMbIHkZHjAGCQgBAoJ0d19WWAMA AQ4KDFRSVD48P6OjpBgeIIiOjmZoaJiamqSlpYCBgVVcWyQmJSQ0KTE4MyAxJBk9IVRZVSBFJTRs PCxXMihTLUB7RxIvFBo9HQcaCCFKIgACAAABAAIIAgcaBwEDARoeGkdJR3t8e7Cxq1VVRmFfT7e2 r6OinHp0VqWgjg0LBVlSP3x2aW1rZ1VCN5aNiQkEA0AHA1E+PRsBAC8FA60lILUnIxwBASkEBEII B6klJcwuLpiXl7u7u6KiomZmZmVlZV5eXlpaWlBQUDU1NS4uLv///wAAAAAAAAAAAAAAAAAAACH5 BAEAAHoALAAAAAAQABAAAAe5gHqCgnF2g4eIVgBSU3KIj1RGSE88gj5Aj3o2TkpNOHpBS3iZekNH STdCTEWkejleRFFQVZk6NWgEEAIrAD90eXc9gnBlbiEgCiAeKS8nLiQ0O3ozaiAcDSINGhQgIBIS CWd1MmkLHCIODg3q6g0RJnNjBRbt6dftEyNbWi0f9ugc2FUwQEYQCxVvGLRrcA7DhjVdBsVAwWDC hQwaLkjo0AYLIjAwSqh4gODAADZZSF0JY0bMFy6IAgEAOw== Create a ToolBar XML file 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. The basic XML template is structured like this: Copy and paste the above code into your new index template. The following is an (untested) example of template that uses MT tags. <[...]



Template Macros: The coolest template trick you don't know about

Fri, 15 Feb 2008 11:42:22 -0800

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 the Photo Gallery plugin outputs such beautiful results. 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: Yikes. 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: my template code was getting very messy. my template code was getting harder and harder to update because I had the same code in multiple places 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. Luckily, Movable Type has exactly what I needed: a little template tag called MTSetVarTemplate. 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 far simpler: Wow, what an improvement! 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: 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:



How to Customize Default Styles in MT4

Sun, 10 Feb 2008 14:04:05 -0800

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: Now what? 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. 1. Create a new index template. 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. 2. Include your new template into the stylesheet template. Go to Design > Templates > Stylesheet. Add the following code to a new line in the stylesheet: @import url(); Save and publish the stylesheet template. Now when you make changes to your customization template, they will be published to the overall stylesheet. 3. Decide what customizations you want to make. 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. A great way to test out your CSS changes in real time is to use the MT Design Assistant. 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 http://www.movabletype.org/design/assistant/. 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: #header-name { font-size: 40px; } and select "Apply CSS" to see the blog title increase in size. 4. Customize your "Style Customizations" template. 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. That's it! Customizing styles in MT requires a knowledge of Cascading Style Sheets or CSS. If you need help with this, there are several good CSS books on the market. Here's a CSS Tutorial and a CSS Cheat Sheet. Many thanks to Mark Carey of MT Hacks, Jesse Gardner, and Beau Smith of Six Apart for walking me through these steps. [...]



Running Publish Queue under daemontools

Sun, 27 Jan 2008 14:05:45 -0800

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's performance and reliability. 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. 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 never want this to happen. Period. 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 any script and ensure that it is always running. If the script/application dies, then daemon tools will restart it. Handy. 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. Ok, before we get started I have to admit something: this article is a little technical. cough. 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 this." 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 daemon tools so that it will automatically be restarted (or "respawned" to use the proper term) if the process for whatever reason dies. Prerequisites You will need each of the following: Movable Type 4.0 or greater daemon tools, a Linux package The simplest way to install daemon tools is via yum or apt. For example, running the following command as root should do the trick: yum install daemontools 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 specific instructions. Setting up the Publish Queue service 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: mkdir /etc/publishqueue Then create a file called /etc/publishqueue/run and enter the following contents into the file: #!/bin/sh MT_HOME=/var/www/cgi-bin/mt cd $MT_HOME exec ./tools/run-periodic-tasks -daemon Change the value of MT_HOME to be the location of the directory that contains mt.cgi. Finally, execute the following command: ln -s /etc/publishqueue /service/publishqueue That will setup daemon tools with the correct scripts and handlers to run Publish Queue. Setting up svscan A program comes with daemon tools called svscan. 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 complete and definitive article that can guide you through this process. The[...]



Fighting Hotlinkers with htaccess

Sun, 27 Jan 2008 10:45:55 -0800

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 your site, to populate their own "made for Adsense" sites. Often the only recourse left to you is to file a DMCA complaint, which can take over a month to resolve.

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 htaccess file 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.

(image)

In the LMT article I wrote about spam 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:


SetEnvIfNoCase Referrer ".*(casino|gambling|poker|porn|sex|nude|xxx).*" BadReferrer
order deny,allow
deny from env=BadReferrer

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.

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.




List Random Authors

Wed, 23 Jan 2008 22:12:24 -0800

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 their fair share of the limelight. A couple of things to note first: Make sure that you’ve got author archives set up. You can hack this to work with author profiles, but that’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’t work; if you’re file extension is .php, you should be fine. $authors[] = '
  • ">
  • '; for ($i=1; $i <= $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]; } ?> First, we set up an array where we’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. Next, we loop through all the authors, stashing them all into an array. Actually, we’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 encode_php='1' filter or else you could get some nasty PHP parse errors and break your site. (Usually because of single quote/double quote mismatching.) Next up is displaying the authors. We’re going to loop through authors 25 times; remember, that’s what we set up with the $show variable. The array_rand function basically says “pull a random number from 1 to the number of items in our array”. We had to put in a special while loop to make sure it didn’t pick a number already used; this would result in duplicate listings of a single author. The array_push then stores the new, non-duplicate random number in our displayed authors array to ensure we don’t duplicate it next time through the loop. Finally, we echo a random item from the $authors array. This loops through however many times you’ve told it to with the $show variable. Note: 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 just after the opening tag. Then just wrap the code that populates the $authors array in an loop, like so: $authors[]... . Thanks to Arvind for helping me solve the dupe problem. He also made me say that I will now worship him forever. [...]



    Share This Post in Movable Type 4

    Sat, 19 Jan 2008 19:58:50 -0800

    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: Social bookmarking sites like Digg, del.icio.us, StumbleUpon 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. To accomplish this we're going to use the Promote This! plugin 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. 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. 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. Share this post:
    (image) digg (image) del.icio.us (image) ">reddit (image) Newsvine
    (image) Google Bookmark (image) FaceBook (image) Stumble Upon 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 <$MTInclude module="Categories"$> and <$MTInclude module="Tags"$> [...]



    How to Export Tags from Movable Type 3.3x

    Fri, 14 Dec 2007 06:09:02 -0800

    Jaclyn asked why she wasn't able to get tags imported to a new MT4 installation. While Movable Type 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.

    First, make a backup of ImportExport.pm 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.

    Using your copy, open ImportExport.pm and locate the line that looks like this:

    sub export {

    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:

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

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

    DATE: <$MTEntryDate format="%m/%d/%Y %I:%M:%S %p"$>
    TAGS: <$MTTagName quote="1"$>
    -----

    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.

    By wrapping everything in the MTEntryIfTagged container, you are sure to only include the line if the entry in question has 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.

    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.

    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.

    This tutorial is written by LMT author Chad Everett of Everitz Consulting.
    Tutorial cross posted on Don't Back Down and LMT.




    Movable Type Scheduled Tasks

    Wed, 12 Dec 2007 12:53:56 -0800

    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 / time. Movable Type plugins can also use scheduled tasks, as some of my plugins do (including Visitor Stats Pro, Ajax Rating Pro, and Blog Janitor). 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.

    Triggering Scheduled Tasks

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

    1. You receive a junk (spam) comment or trackback. Note: this will only trigger the 'Junk expiration' task - it won't trigger plugin tasks.
    2. 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).
    3. When the run-periodic-tasks script (found in the 'tools' directory of MT) is run via the command line or via cron.

    Testing Scheduled Tasks

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

    1. Go to System Overview > Activity Log.
    2. Click the "Activity Feed" link on the right side of the page.
    3. After the XML feed displays, hit the back button.
    4. Now refresh the System Activity Log.
    5. 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.

    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.

    Setting Up a Cron Job

    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: Scheduled Postings and Cron Jobs.




    Add Scrollbars to Image Popup Windows in Movable Type 4

    Thu, 22 Nov 2007 19:48:48 -0800

    I post a lot of thumbnail images on Consuming Louisville that link to very large full size images. By default Movable Type doesn't add scrollbars or allow resizing for the popup windows created for images. That's a problem because those large images of mine get cut off with no way to expand the window or scroll to see the rest of the image. So of course I needed to turn on scrollbars and turn on window resizing for image popups.

    Like with changing the default image upload location I wish that there was a simple way, within the Movable Type application, to do this but there isn't one as far as I know. Instead we have to do a little monkeying around with the Movable Type application code. But, again like with changing the default image upload location, the is actually quite simple and only requires editing a single line of a single file.

    The file to edit is called Image.pm. Assuming you have your Movable Type files in your cgi-bin the path to this file looks something like cgi-bin/mt/lib/MT/Asset/Image.pm.

    1. Download Image.pm (I highly recommend you save a backup copy of it before you edit it)

    2. Open Image.pm and look for the following:
    q|%s|,

    3. Change
    scrollbars=no,resizable=no

    to scrollbars=yes,resizable=yes

    So your final code should look like:
    q|%s|,

    4. Save and upload Image.pm

    Now, the next time you have Movable Type create a popup window for the full size version of an image that popup window will have scrollbars and viewers will be able to resize it.




    Install Movable Type 4 in Yahoo! Small Business

    Fri, 09 Nov 2007 08:49:14 -0800

    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't really seem to support MT4 at Yahoo! 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. You will need to get a copy of MT4. Go on, I'll wait. Got it? Good. Now go get an FTP program too. If you don't have one, try WinSCP because it works really well. Got it? Good. Now just one more thing - you need to be able to unpack your distribution. I like WinRAR here, but WinZIP or something should work too. Got it too? Good. Now you're ready to proceed. 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 MT-4.01-en. 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 blog-mt. 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). Now you need to log into your account at Yahoo! to perform a few tasks. Go to the Web Hosting Control Panel and select Create & Update, then select MySQL Database. We need to do two things here - first set up an administrator password, then install phpMyAdmin. The first step is to assign a password. Select Database Administrator, 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 random string generator. I generally create 16-character passwords with numbers, uppercase and lowercase letters. But that's me. You can make it whatever you like. Once you save your password, select Install Admin Tool. You need to agree to the license agreement. Then create a new directory, and click Install phpMyAdmin 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. 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 must open it in Internet Explorer. Don't forget or you'll be left wondering why it's not working. Trust me on this one. Once you do, you need to select your existing Movable Type database from the drop-down in the left column. By default, this is mt. 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. After the database loads, select the Operations tab and locate the Copy Database To section towards the bottom of the page. Enter the name of the new database (we're copying here, so that we don't m[...]



    Favicon and Gravatar in MT4

    Fri, 09 Nov 2007 01:57:20 -0800

    Two of my favourite Movable Type plugins from versions prior to MT4 are Favicon and Gravatar. Both these plugins work fine in MT4 and it’s only a matter of knowing where to put them in the template modules. Favicon is a plugin for Movable Type that adds favicons to comments and trackbacks. Download and install the plugin as per the instructions on the download page. Follow the directions there for installing into MT versions prior to 4.0. The following instructions only apply to Movable Type 4. Go to the Movable Type dashboard in your browser, Design > Templates > and click on Template Modules. Open the Comment Detail module. Place the following code right before the <$MTCommentAuthorLink default_name="Anonymous" show_email="0"$> tag and save the changes. <$MTFaviconComment full="1"$> Open the Trackbacks Module and copy the following code to the footer section, placing it just before the words “Tracked on….”. Save your changes. <$MTFaviconTrackback full="1"$> Rebuild your entry pages to see the favicons in action. A gravatar is a globally recognized avatar, that can be a picture of yourself or anything you like that is linked to an email address. When you leave a comment on a site that has gravatars enabled, a picture appears next to your comment. Three different versions are available for Movable Type, depending on how your blog is set up or how you want to install it. I have the MovableType CommentBodyPlusGravatar Plugin installed. When used inside the MTComments tag as a replacement for MTCommentBody, outputs the comment body and inserts the gravatar image code inside the opening

    tag. This is important if you want to use CSS to float the image so that text will wrap around it. Download and install the plugin, and follow the instructions for the version you’ve chosen. Open the Comment Detail module and insert the tag inside the comment content section. Here’s an example of how mine looks.

    <$MTCommentBodyPlusGravatar class="floatimgright" size="40" rating="R" default="http://mt4.juneeonline.com/avatar.gif"$>

    Use
    to push the next comment down so they don’t pile up on top of each other or overlap. Don’t forget to rebuild your site to see the changes. [...]



    Make Flickr's Blog This Feature Work with Movable Type 4.0

    Thu, 08 Nov 2007 13:00:19 -0800

    This tutorial is cross posted at On a path media

    Actually this applies to any version of Movable Type since 3.2 and to all kinds of external apps for posting to your Movable Type blog. I just suspect that the Blog This feature from Flickr is probably the most popular external blogging tool out there and it's really frustrating when you can't get it to work.

    I should mention this post was inspired by my friend Cecily who recently wrote about posting from TextMate to a Movable Type blog. Her post reminded me about how the web services password can cause problems when setting up a Movable Type blog to work with Flickr's Blog This feature.

    When you go to setup your Movable Type blog with Flickr you'll be asked for your password. Many folks put in their password only to be told its incorrect. They check and double check and absolutely certain they're putting the right password in only to still be rejected. The problem is that Flickr doesn't want your main blog password (the one you use to login to your blog with). What Flickr wants is your web services password.

    (image)

    If you don't know what your web services password is that probably means you haven't set one up yet. System Overview -> Users -> Your User Identity

    flickrblog.png

    If you don't know what your web services password is that probably means you haven't set one up yet. System Overview -> Users -> Your User Identity
    webservices.png

    If you haven't set up a web services password the field will blank. If you have but can't remember what it is just click the reveal link and it will be shown. Now tell Flickr what your shiny new or newly revealed web services password is and you'll most likely be good to go.




    Install Movable Type Under Windows (IIS)

    Fri, 02 Nov 2007 07:48:33 -0800

    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'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. 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, MySQL and Perl. If you want to use dynamic publishing, you'll also need PHP - but I'm not going to cover that here. Maybe next time. Ready? Let's go! I should probably cover a few questions. First, MySQL and Perl. MySQL is a database. If you're familiar with Microsoft 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. 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 MySQL Community Server. 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 MySQL GUI Tools. 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. Perl 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. 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 mt, and can be found inside your wwwroot directory, along with your other website files. You will likely need to install two modules before Movable Type will work. This process is started from the command line. Click Start, then Run, then enter CMD and press ENTER. At the command line, type ppm (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 ENTER. This starts a graphical installation utility. 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 View menu item, then select All Packages. In the search box, enter dbd-mysql (case is not important). You should see three packages listed - DBD-mysql, DBD-mysql-SimpleMySQL and DBD-mysqlPP. Next to each are three columns: area, installed and available. We want to see if DBD-mysql is installed. It probably is not. Click the row that contains DBD-mysq[...]



    Upgrading to Movable Type 4 with MTCommentFields

    Fri, 26 Oct 2007 10:06:40 -0800

    By now, there's a reasonable chance that if you've wanted to upgrade to the latest release of Movable Type, 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. One of the issues that I run into fairly regularly is for people who use the MTCommentFields 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. If you're still using it and you want to upgrade, you'll see a message that reads The MTCommentFields tag is no longer available; please include the Comment Form template module instead. You will be able to rebuild your templates, but you won't be able to accept any new ones. 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 still have problems. What do you do? Luckily, it's an easy fix. To fix this problem, you need to first make two changes to your Individual Entry Archive 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. First, click on Design, then Archive Templates. You are looking for the Individual Entry Archive template. Near the top, locate the JavaScript in the template. It will look something like this: