November 05, 2005

Ordering Categories in MT 3.2

I wanted to custom order my categories and subcategories however, by default, MT is ordering the categories alphabetically and there are not any tag filters to change this behavior. So, I searched the forums and Web for a possible solution to this problem. One of the solutions was to name your categories “1. Category1”, “2. Category2”, and so on. However, this solution was not applicable for the Setup32.com Web site because I’ll miss some important keywords (SEO related) in the link anchor to the category as well in the URL for the category archive. For example, in regards with SEO “Windows 2000” and “1. Windows 2000” are two completely different things. The first one is a great key phrase, and the second one… well, it would be good if a user search for exactly the same phrase – “1. Window 2000”.

The second solution is to use the Brad Choate's MTRegex plugin to search and replace the extra numbers in the beginning of the category label.

You can find some of the examples published here and here. I decided to modify and adopt the sample regex to my own needs. I named my directories using the following pattern:

  01. cat1
  02. cat3
  03. etc.

Then, I have used the following code to display the categories and subcategories:

<MTIfArchiveTypeEnabled archive_type="Category">
  <MTTopLevelCategories>
    <MTSubCatIsFirst>
<ul class="module-list">
</MTSubCatIsFirst> <MTIfNonZero tag="MTCategoryCount">
<li class="module-list-item"> <a href="<$MTCategoryArchiveLink$>" title="<$MTCategoryDescription$>"> <MTCategoryLabel regex="s|^([\d\d\.\s]*\s*)||"></a> <MTElse> <li class="module-list-item"> <MTCategoryLabel regex="s|^([\d\d\.\s]*\s*)||"> </MTElse> </MTIfNonZero> <MTSubCatsRecurse>
</li> <MTSubCatIsLast> </ul> </MTSubCatIsLast> </MTTopLevelCategories> </MTIfArchiveTypeEnabled>

You should apply the regex filter for your archive paths too:

I used the following for the individual archive:

<MTParentCategories glue="/">
<$MTCategoryLabel regex="s|^([\d\d-]*\s*)||" dirify="1"$>
</MTParentCategories>/%b.html

And the following for the category archive:

<MTParentCategories glue="/">
<MTCategoryLabel dirify="1" regex="s|^([\d\d\.-]*/*\s*)||">
</MTParentCategories>/index.html

You can notice that the actual regex is slightly different for the archive paths. This is because of the additional dirify filter used in the MTCategoryLabel tag.

Now, what the above codes produce? For example, I have a category named Installation and Configuration with a sbcategory Active Directory. These categories are named

------

02. Installation and Configuration
 |-  ------
 |-  ------

 |-  03. Active Directory

In the categories list displayed on the site they appear as Installation and Configuration and Active Directory respectively, and the ULS to the archives are http://www.setup32.com/windows-2000-resource-guide/installation-and-configuration/ and http://www.setup32.com/windows-2000-resource-guide/installation-and-configuration/active-directory/

Nice, huh? 

November 03, 2005

Using MTMultiBlog plug-in

The Setup32.com site contains a different blogs for every major category, i.e. News, Resource Guides, Network Administration etc. All these blogs save the pages in a different directory.

So, how to update the top domain index automatically using the articles posted in the other blogs?

The solution is: MTMultiBlog plug-in by David Raynes.

“MultiBlog is a plugin that provides the user with the ability to include templated content from other blogs in their MovableType installation. It also allows the user to define rebuild triggers as normally posts to one blog do not cause rebuild in another that might be including content from it. Finally, MultiBlog allows the user to define access controls for the blogs in their system, to prevent one blog from accessing the content of another.”

And here are some real word examples:

<MTMultiBlog include_blogs="1">
<MTEntries lastn="1">
<h2><a href="<MTEntryPermalink>"><MTEntryTitle></a></h2>
<p>Posted in: <a href="<MTBlogURL>"><MTBlogName></a></p>
<MTEntryBody>
<p>[<a href="<MTEntryPermalink>">more</a> | <MTIfCommentsActive> <a href="<$MTEntryPermalink$>#comments">discuss (<$MTEntryCommentCount$>) </a></MTIfCommentsActive>]</p> </MTEntries>
</MTMultiBlog>

This code will insert the latest entry from the blog with ID=1.

<MTMultiBlog include_blogs="5">
<h2>Latest News</h2>
<ul>
<MTEntries lastn="5">
<li><a href="<MTEntryPermalink>"><MTEntryTitle></a></li>
</MTEntries>
</ul>
</MTMultiBlog>

This code will insert a list of links to the last 5 entries posted in the blog 5.

You can find some more examples and info about the MTMultiBlog plug-in here.

November 02, 2005

Why Movable Type?

Briefly, the requirements for the Setup32.com Web site were something like:

  1. Ability to create and maintain a deep category structure.
  2. Ability to assign the documents to multiple categories.
  3. Ability to produce a clean and valid XHTML code.
  4. Ability to customize the templates.
  5. Ability to produce search engine friendly URLs.
  6. Ability to use all SEO related tags – h1, h2, h3, alt, etc.

At first I wanted to try Joomla CMS (formerly Mambo) for this project. However, it was impossible to comply with at least 3 of the above requirements. First, it is impossible to create a deep and complex category structure with Joomla. You’re forced to stick with the very old Section/Category model, i.e. the directory structure can be 2 levels deep.

Second, in Joomla it is impossible to assign a document to multiple categories. I really hope the development team will come with some updates shortly. In fact, the lack of the above two abilities makes Joomla inappropriate choice for a large number of projects.

And third, Joomla still produces ugly and not valid table-based code.

So, Movable Type in action :)

I hope to show you how Movable Type can be used for building large and complex Web sites. i'll use Movable Type 3.2 for this project. Please visit Six Apart's web site for all the new features in Movable Type 3.2

Welcome!

Welcome!

Ok, here we go... my first post here :)
I was assigned to create, design and maintain the Setup32.com Web site for a client. I’ll try to track the progress of the work here. In addition, I’ll post some tips and tricks on working with Movable Type, customizing the templates, hacking the code, etc.

I hope this blog will help me to track the changes to the client’s site in addition to providing some useful info for you, my future readers :)

And of course, many thank to the owners of the main site for allowing me to host this blog on theirs hosting account ;)

P.S. I’m very sorry for my poor English, but it is not my native language.