Add Scrollbars to Image Popup Windows in Movable Type 4
November 22, 2007
| Permalink
| Comments (0)
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|<a href="%s" onclick="window.open('%s','popup','width=%d,height=%d,scrollbars=no,resizable=no,
toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">%s</a>|,
3. Change scrollbars=no,resizable=no
to scrollbars=yes,resizable=yes
So your final code should look like:
q|<a href="%s" onclick="window.open('%s','popup','width=%d,height=%d,scrollbars=yes,resizable=yes,
toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">%s</a>|,
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.
How To Change the Default Image Upload Location in Movable Type 4.0
November 22, 2007
| Permalink
If you're using MT4.1 see the note at the end of this article.
I have a site called Correspondence Notes. The site is about written communication as well as the tools and materials that go along with it. It contains lots of fawning over and geeking out about stationery and note cards. Like all of my sites Correspondence Notes is powered by Movable Type.
Nearly every article for Correspondence Notes contains at least one image. I use Movable Type's built in upload feature to upload images and add them to entries. The process is fine except for one step. By default Movable Type will upload images to your Site Root. That's great except I like my images to go into a subdirectory I like to call...images. I can of course, with the file upload utility, tell Movable Type to put the images into the images subdirectory. The problem is that the utility will not remember this preference. Every time I upload an image I have to tell Movable Type again to put the new image in the images directory instead of the Site Root. Though it only takes a few key strokes to type "images" into the subdirectory field it's a silly time waster since I want every single image I upload to go into that folder.
Since there isn't an option within the Movable Type user interface to make the file upload utility remember that I want my images to always go into the images subdirectory I decided to go straight to the source and make it happen. Please remember that if these steps break your copy of Movable Type I'm not the least bit responsible.
Configuring the upload utility to upload to the same subdirectory by default is actually quite simple. It only requires editing a single line of a single .tmpl file. However, if monkeying with an application's source code makes you really nervous I've heard there is a great plugin for improving Movable Type's file upload utility that only costs $10.
The file to edit is called asset_upload.tmpl. Assuming you have your Movable Type files in your cgi-bin the path to this file looks something like cgi-bin/mt/tmpl/cms/dialog/asset_upload.tmpl.
1. Download asset_upload.tmpl (I highly recommend you save a backup copy of it before you edit it)
2. Open asset_upload.tmpl and look for the following:
/ <input name="extra_path" id="extra_path" value="<mt:var name="extra_path" escape="html">" />
3. Change
value="<mt:var name="extra_path" escape="html">"
to
value="images"
where "images" is whatever subdirectory name you want your images uploaded to by default.
So your final code should look like this
/ <input name="extra_path" id="extra_path" value="images" />
4. Save and upload asset_upload.tmpl
5. Upload an image
You'll notice that the subdirectory field is still completely editable. So while Movable Type will, by default, now upload my images to the images subdirectory, should I want to upload a particular image to a different directory all I have to do is type a different name into the subdirectory text box.
Update for MT4.1 This procedure is almost exactly the same in MT4.1. The only difference is the actual location of the asset_upload.tmpl file.In MT4.0 the file was found here: cgi-bin/mt/tmpl/cms/dialog/asset_upload.tmpl
In MT 4.1 the file you want to edit is now: cgi-bin/mt/tmpl/cms/include/asset_upload.tmpl
Take Your Gmail Contacts to Thunderbird (Mac Only)
November 8, 2007
| Permalink
| Comments (2)
As soon as Gmail rolled out IMAP support I jumped on the band wagon and started configuring Mail.app and dipping my toes back into the desktop email client waters. Things didn't go as smoothly as I hoped. I found the combination of IMAP, Gmail and Mail to be less than optimal. Then I found Lifehacker's article on how to "Turn Thunderbird into the Ultimate Gmail IMAP Client" and decided to give Thunderbird a go. A week in I find Thunderbird to be pretty great and using it in concert with Gmail is working out pretty well. One major problem though is that, as far as I can find, there isn't a direct or simple process for getting your Gmail contacts into Thunderbird. You can export your Gmail contacts into a .csv file but it doesn't play nicely with Thunderbird in my experience. It doesn't play nicely with Address Book either (I know I tried getting my Gmail contacts into Address Book over the summer).
After much digging I finally found a work around for getting Gmail contacts relatively neatly into Address Book. I also found a work around for getting Address Book contacts into Thunderbird. Put those two processes together and you've got your Gmail contacts in Thunderbird.
Let me warn you that this is a rather convoluted process that requires you to download and run an Apple Script and an application and even then your address book probably won't be exactly perfect (meaning you'll have to either edit a .csv file or edit your contacts post-Thunderbird import) nor will your Gmail contacts and your Thunderbird contacts stay synced. The lack of syncing is obviously not ideal. However, I have a rather large, static base of contacts that I needed to have in Thunderbird that doesn't get changed. The number of new contacts I get it isn't minuscule but it is small enough that I can manually add them to both places if need be. If you get 15 new contacts a day this probably isn't an optimal solution for you.
The first step is in this process is exporting your Gmail contacts. In the export options choose Gmail to Outlook CSV. Next download Steve Roy's Address Book Importer 2.0.5. This app is free if you use it only once. If you want to use it more a $10 fee is requested. Address Book Importer has a drag and drop interface that allows you to get the contact information from the Gmail .csv into the proper address book fields. Depending on how meticulously detailed your Gmail contacts list is you could be dragging and dropping a lot or a little. Either way this is going to take a little time. I accepted that, went through the process and was happy I did.
After your Gmail contacts have been safely imported into Address Book download and run the Address Book to CSV AppleScript from Sean Long (hint get the full package listed in the comments of that link instead of just the .scpt file). This script will spit out all of the contacts in Address Book into a new .csv file. The drag and drop process you used with Address Book Importer should have allowed the new .csv file to be nice and tidy and just the way you like it. Meaning it will play nicely with Thunderbird unlike the original .csv file that Gmail created.
So just go to your Thunderbird address book, import the new .csv file and think to yourself "There has got to be an easier way than this but I'm glad this worked for now."
Make Flickr's Blog This Feature Work with Movable Type 4.0
November 8, 2007
| Permalink
| Comments (0)
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.
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
Continue reading Make Flickr's Blog This Feature Work with Movable Type 4.0.