Hi, my name is Takeshi "Nick" Osanai of Six Apart Ltd. Today, I'm going to post a translated blog article which was originally written by a Japanese Movable Type developer Sumio Noda. He is also known as his nickname "Junnama".
Sumio is a famous Movable Type developer in Japan. He is the co-founder and CEO of Alfasado Inc., one of the largest third-party developer in the worldwide Movable Type Community.
Alfasado develops and distributes Enterprise plug-in packages that extend MT called "PowerCMS". Alfasado also introduces a lot of plugins on Github. Take a look at Alfasdo's account on Github, at https://github.com/alfasado to get an idea of what they have produced and made available to the MT community.
So, let me introduce his blog entry "Reasons why I keep using Movable Type, not WordPress, because it's fun!"
The original entry in Japanese: http://junnama.alfasado.net/online/2012/04/wordpress_movabletype.html
People often ask me, "Why do you keep using Movable Type, not WordPress?", I answer it "Because it's Fun!" It's fun for me as a developer and Product Manager of "PowerCMS", and also as the CEO of a CMS solution vendor.
"MTML" is a Big Part of the Fun
At the most basic level, all of us at Alfasado Inc. think it's fun to use "MTML," Movable Type Markup Language. MTML is probably the most popular template engine in Japan.
Here are portions of typical Movable Type and WordPress templates where each requests 10 blog entries to be listed.
<ul> <?php $myposts = get_posts('posts_per_page=10'); foreach($myposts as $post) : setup_postdata($post); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul>
<ul> <MT:Entries limit="10"> <li><a href="<MT:EntryPermalink>"><MT:EntryTitle></a></li> </MT:Entries> </ul>
I'm not simply asking "Which code is better?"
List of "how I like" each of these codes, not line-by-line comparison.
When you write a Movable Type plug-in, plug-ins code consists of one or more YAML files plus Perl modules that are written to take advantage of MT's object-oriented architecture and APIs.
In Movable Type, you cannot embed programming logic in templates using Perl or PHP, but only MTML. MTML can perform relatively complex logics, but unlike WordPress, Movable Type does not allow you to embed Perl code or execute shell commands in templates.
In fact, it is not common to write the code in MTML like what is shown in the sample code above. MTEntriesHeader and MTEntriesFooter allow you to put ul tags at the beginning and end of a list of entries displayed by the MTEntries container tag. If you want to do the same in WordPress, you must resort to writing PHP code.
The PHP code can be embedded in WordPress templates. This means that WordPress templates can run server-side commands using the PHP "exec" function. (To be precise, the PHP code can be stored in Movable Type templates, but the Movable Type template simply produces ".php" file that can be executed by the PHP interpreter unless the administrative policy prohibits the execution of the PHP code. Same as the Java code and ".jsp" file.)
Movable Type separates logics from template design, while WorldPress mingles logics and design
In Movable Type, you write plug-ins in Perl (or PHP), but templates only in MTML. Logics are written in plug-ins in Perl or PHP( as a scripting language) whereas design is stored in templates in MTML (as a template language).
In WordPress, both plug-ins and templates are written in PHP, so you can embed business logic in both places. This may mean "flexible", but it also makes the place and manner of inclusion of business logic a bit vague. To make matters even more complicated, in WordPress you can build presentation into a plug-in as well.
Although it is certainly possible to create a properly-designed theme framework for use with WordPress, good development and maintenance practices certainly are not required.
Different philosophies of Security and permissions in Movable Type and WordPress
Movable Type has series of user roles that can be used to keep users from deploying code in Perl or PHP, but still allow them to use MTML. In Movable Type, the template-editing role is called "designer". The designer does not have permission to write Perl (or PHP) logic, or include any file available on the server to display (as you may know, since MT 4.38 and 5.13, the MTInclude tag has been disabled by default).
The design philosophy of security and permissions in Movable Type is that the designer of a website should not be able to do those actions. Users who can deploy Perl and PHP programs are those who have the technical understanding and authority to setup plug-ins on a server. So the designer and server manager roles can be strictly separated.
This does not have much meaning when starting and managing a personal website or an individual blog, but is absolutely necessary when managing corporate or institutional websites, such as official websites run by governments.
There is another advantage associated with a "static publishing" CMS, such as Movable Type. You may want to physically separate the content-publishing server from the distribution server for security reasons, again using my example of managing a government-related website. I do not know how the Japanese prime minister's official website is managed, but I suppose that using a dynamic-publishing CMS safely in that situation is highly difficult.
What's fun for programmers is to extend a language.
From a server-side engineer's point-of-view, the greatness of developing Movable Type all comes down to "extending MTML". You can make tags to extend language and let others use them. It is not just applying design to themes or templates, but much more than that.
Here is a template logic that you can create that permits a designer to build Facebook applications using MTML:
<MTIfFacebookLoggedIn> Welcome, <mt:FacebookUserName escape="html">! <a href="<mt:FacebookLogoutURL>"> Logout </a> <MTElse> <a href="<mt:FacebookLoginURL>"> Login via Facebook </a> </MTIfFacebookLoggedIn>
For a publishing company's website, template tags to display a list of books can be defined and implemented like this:
<MT:Books limit="10"> <li><a href="<MT:BookPermalink>"><MT:BookTitle></a></li> </MT:Books>
Once you have finished defining MTML tags, you can have a designer handle the rest of the website presentation. Important is that you can separate low-level programming and the design of the final website presentation. Programmers who define tags, and designers (or front-end engineers) who write tags in templates, do not share the same files or templates.
The beauty of creating your own MTML tags is that such tags can be reused in other projects. With MT, each presentation is written by designers using the same tags once programmers define their tags. As you know, programmers are so lazy that they hate writing similar code for each website whose purpose is very similar.
Fun as a manager #1: Being able to establish the style to build as a team
Being able to divide areas of tasks between server-side engineers and front-end engineers lets you establish your team's work style. Engineers who have different skills can work simultaneously.
I can tell you from my experience that writing templates entirely in PHP puts too much burden on the server-side engineers. First of all, if engineering is not divided, there is no question who has the heaviest burden.
It is always hard to find skilled engineers these days. As long as front-end coders understand HTML and MT tags, there can be much to do for them and thus it is easy to assign them to tasks.
Fun as a manager #2: You do not panic even when employees quit.
Of course, managers always need to keep in mind that good employees may eventually leave your company. Let's say that one of your clients visits your office to discuss his website, asking to update it. The employee who was in charge of building it originally is now gone. Imagine how troublesome and risky this can be.
There are two advantages of using Movable Type. The first is that Movable Type makes it easier to manage websites using a team approach. The second is, and this is more important, that it is easy to pinpoint where to fix, if the website is built with Movable Type.
- Go step-by-step through the templates
- Verify the code at the MTML tag level, if applicable
By doing this, you will know where changes need to be made. If you have standardized the process of development using MTML and Movable Type plug-ins, you can greatly compress the process of understanding the website structure, resulting in a faster site revision.
Fun as a CEO from business aspect
Because I write code and manage the business also, I understand what is fun about using Movable Type. But there is more.
In Japan, especially after Movable Type 3 was released, so many websites were built with Movable Type. So there is huge business opportunity to extend, renew, or manage them.
Of course, there are websites built by WordPress as well. But I would rather not to take care of heavily customized WordPress websites for the reasons I stated earlier.
It is relatively easy to get cooperation from Six Apart because they are based in Japan and offer commercial licenses. They take the responsibility for auditing platform security and a number of other things.
Movable Type is, in fact, an "application development platform"
In this post, I focused pretty much on development style of template engine. Although WordPress and Movable Type seem to look similar as CMS, they are very different inside.
Movable Type has elements of a development platform. As developers, we can:
- enhance MT::App and use it as a web application framework
- use an Object-Relational mapper (MT::Object)
- use MTML (Movable Type Markup Language)
- use the MT 5.1 Listing Framework
- take advantage of the pluggable structure
- use DynamicMTML (which my company developed)
of the platform, for development beyond Movable Type's core CMS functons.