Finally Somewhat Custom Upload Paths for MovableType

May 31st, 2009

This was unfortunately much more difficult than I had hoped. What I wanted to do was supply an absolute path for the asset upload, and have the paths for thumbnails built automatically by MovableType.

I was able to hack this into being by specifying the static directives as the asset url and path, like this:

  • set target static uri in mt-config.cgi
  • override it in the templates:
    • include/archetype_editor.tmpl
    • include/header.tmpl
    • dialog/header.tmpl

First I tried this, but it wasn't what I wanted:* Edit /usr/share/perl5/MT/ line 83:

: $1 eq 'r'           ? MT->instance->static_path

Also line 62.

ACTUALLY NO - instead changed lines 1004 and 1009 in /usr/share/perl5/MT/CMS/

to %s instead of %r. This will move only the asset, not the thumbnail.

I also used this technique to specify the sub-directory of the static directives.

And MediaUrls helps for general media resources.

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022