Doing your whole site with MT
Matt Haughey has a great article on how he uses Movable Type to do it all (apparently, Kottke does too... can't wait to see his article).
Anyhow, I wanted to share a tidbit in that vein. I've just set this up recently, and I'm in the process of moving the rest of my static content to use it. What I did:
- Created a new Movable Type blog and named it "bradchoate.com: Static Content".
- Deleted all the Index templates.
- Deleted all the archive templates, except for the Individual archive template.
- Made sure individual archives were enabled.
- Made the archive path the root directory of my web site.
- Created categories for each directory I want to create content for (category name = directory name)
- Used the following for the Individual Entry Archive filename template (specified on the "Archiving" page of your weblog configuration). Produces: "category/entry_title.html":
<$MTEntryCategory lower_case="1"$><MTIfNotEmpty var="EntryCategory">/</MTIfNotEmpty><$MTEntryTitle dirify="1"$>.html
So with this setup, instead of using your Index templates for your separate pages, they all become their own entry. This seems more appropriate to me. It also lets you use the excerpt and keywords field to store additional metadata about that particular page. So when you build, the individual file created for my "About" entry is named "about/index.php" since it has a category of "About" and an entry title "Index".
You can do your individual file archive template any number of ways. The technique above will rely on the category assignment to define what directory to put the file. Here are some alternatives:
- Category defines directory (ie: "About/Something"), entry title is the full filename including extension (ie: "summer_vacation.html"): Produces: "about/something/summer_vacation.html":
<$MTEntryCategory lower_case="1"$><MTIfNotEmpty var="EntryCategory">/</MTIfNotEmpty><$MTEntryTitle$> - Entry title is the full path and filename (ie: "about/something/summer_vacation.php"). Category isn't used to name the file at all. Produces: "about/something/summer_vacation.php":
<$MTEntryTitle$>
- Category defines directory path (category label looks like "about/something/"). Entry title is descriptive (ie: "Summer Vacation"). Produces "about/something/summer_vacation.html":
<$MTEntryCategory$><$MTEntryTitle dirify="1"$>.html
The "IfNotEmpty" tag (provided through the IfEmpty plugin) allows you to test for no category assignment. If a category is not defined, then the '/' prefix is left off the filename, so the file would go into the top directory of the weblog.
This benefits of all this are many. Because now I can use Textile formatting for any page of my web site. I can also make use of Movable Type's search feature to search any page of my site instead of just my weblog content. I can also enable comments, trackback or whatever for any page I'd like.
Hey Brad, thanks for sharing this. I've been using the index templates but I'm going to try out your method on a couple of my websites.
I wonder how one would go about doing sub-categories...
/bigtopic
/bigtopic/moregranulartopicthatisstillunderbigtopic
Brad, this is awesome. I've always thought that this should be feasible, but have not sat down to map it out. You've saved me the trouble.
On a related note, with your Smarty tutorial, you pointed me down that path and now my entire site is Smarty templates.
Brad, this is a novel approach to me and I like it very much. In my original post on stopdesign I talked about doing a static content blog with templates and template modules which is great, but lacks searchability.
One thing I will say is that I don't like the idea of having to create a category for every directory (or sub-directory) I want to write to especially for client work, since that is non-intuitive and frankly a pain in the butt. However, the alternative of having the client's main About page come up in the search with the title /about/index is just Plain Ugly.
I think that the way that I would do it would be to use the title for the proper page title and the EntryMore field for the whole path to the file. Sure it could be used for storage or something else, but it's not as semantically useful as say the keywords or excerpt fields....
Anyhow, thanks for putting this out there. I is a great idea.
I have done this too -- takes me longer to document things and toot the horn -- that's why some people get more traffic. :)
I wanted to provide student organizations at my institution an easy way to manage their content. I set things up exactly in this manner last winter -- and am rolling it out to them this fall.
Thanks again Brad! I already linked-up your 'colophon' article on my blog as part of a short summer reading list on how to move movabletype into a content manglement system.
Cool. Now I can add this! And thanks for all you do!
Great! You can even use bookmarklets to blog on "Static Content". =D
Jay Allen raises some good points, however, I would suggest instead of the Entry More field, use the Keywords field of Movable Type. Something like this:
field1=foobar
field2=the quick brown fox
You can then either apply some nifty MTPerl (thanks to Brad), or you can do what I do and throw the fields around the title, the header, the meta tags, various points of navigation or wherever you need it.
I discuss the PHP solution to some degree on my own blog, though the code is very Perl-ish.
Dude, that's pretty much exactly what I've been wanting to do for a while. I was looking for some way to do static content within MT so I didn't have to use two different applications and keep templates syncronised between them. In the end, I just decided to write the static content as regular entries in MT.
I'll give this a spin, though.
THANK YOU SO MUCH!!! I really appreciate this because I have all of my pages as index files, but of course, the search engine is using none of them except for my blog/main index page. I have been searching for a way to do just this! *whew* I’m not savvy enough yet to quite understand how these content programs work, so I'm grateful you're sharing your wisdom! :)
Argh, that's a great idea - why didn't I think of that? I am developing a site with static and dynamic content, and I thought I was being incredibly clever putting all my static data in the MT templates and then using some kind of google search function to search parts of the entire site. This handles it a million times better. Thanks a mill.
Hmm. Did this a while ago on Eloquent Apathy ( http://www.eloquentapathy.com/ ) and I know Not So Soft ( http://www.notsosoft.com/ ) did this before then as well.
Not so new. :( Though, here's what I did that's a little different.
My content is both static and bloggish. In other words, while using so-called static content like an about page, I allow comments on everything so that people can basically leave whatever comments about that page they like. On my about page, though no one has done it because I'm low-traffic, someone could ask a life question or something and I could answer there. Just a variation.
Also, I use categories for sections/directories and category indexes for the index.php page. Thus a summary of that category. It's in-between static and dynamic, really, but it's zero-maintenance.
Some pointers. :)
I am integrating static content by using the blog descriptions. The blog description is displayed on the top of each blog page above the entries (or there are no entries - just the static description).
I have a large number of content managers who don't even want to look at the MovableType admin screens so I've made something that looks like a Bookmarklet that brings up the blog description, allows users to edit it, and rebuilds the site on saving changes. Then they can refresh the page and voila! - the changes they just made to the static content are instantly published.
The only catch to this is that searches on the site only work across blog entries, so all the static content is ignored. Does someone have a nifty hack to have the search run across entries and descriptions? (I've posted to the MT support tips & tricks forum on this issue too... http://www.movabletype.org/support/index.php?act=ST&f=14&t=24344 )
Hello! I've been tinkering with macros for a bit now, and I'm finding it difficult to make multiple <MTMacroDefine> tags inside a single MT module. I'm using MT 2.64--it seems to choke when there's more than one macro defined in a single module.
My module looks like:
And so on and so forth. I deleted all newlines and blank lines so that it's just a big blog of text. But it seems that if there's more than one <MTMacroDefine> in a single module, MT won't successfully rebuild the template(s). If I delete all but one MTMacroDefine, it works perfectly. I don't want to have to include a bunch of modules just so that I have the ten or so emoticons I have ready for my journal. Can you possibly help me?I also referenced http://www.thegirliematters.com/tips/archives/0209/smilies_with_mtmacro.php as I tinkered, who seems to be able to have all her emoticons in one module, whereas I cannot. Puzzling..
I'm using the default MT template, the emoticon module is the only augmentation. I use apply_macros="1" within the MTEntryBody and MTEntryMore tags. Is there something else I need to include?
Thank you so much for a really interesting script. :)
Aww, poo, wrong forum. I'm sorry about that.
Hey, thanks for a great article. One small problem I have with this approach: on the individual archive pages, the MTPrevious and MTNext tags point to the previous and next entries in any category, which is a pain -- I'd like to get them pointing to other entries in the same category if I can. Do you know of any way of doing this? I looked at CatEntries and your Supplemental Category Tags plugin, but neither of these seems to do what I need.
Any help in this regard would be greatly appreciated :)
Thanks,
Matt
I did it! Or rather, I made two test static pages using your directions, though I only used
.html
on the archiving page. I currently keep my static content in flat files that get wrapped in a format via Perl scripts so I should be able to create an input file to load into Movable Type.
Thanks for documenting this method.
For some reason I cannot get my head around MT 2.64 since setting it up a few weeks in regards to my purpose. I want to set up a static front page that, of course, utilizes some dynamic information from the MT blogs. I want to set up a community directory for my small town that utilizes a separately named sub-domain for each category i.e. entertainment.my-hometown.com or events.my-hometown.com. In fact, 50 sub-domains for each category.
I want the static index page in the root directory to contain every link to the index page of each sub-domain. It is THERE in each sub-domain that blogs are posted and searched. Yep, 50 blogs, so far, each posted by pre-selected clients who log-in with password protection. Latest news, specials, sales, changes of schedule, public announcements.
I have read the "Doing your whole site in MT" info on deleting index templates, and almost all the archive templates, etc. Brad, given my desired scenario, is there anything to add or modify about your instructions? Any caveats?
And does managing this many sub-domain blogs sound gargantuan?
Feeling mighty Lost and mighty MT