Industry guru Dave Taylor answers free tech support questions about a wide variety of business and technical topics, including blogging, Google AdSense, MySpace, Sony PSP, Apple iPod, Mp3 players, management, Linux, SEO, Mac OS X, Facebook, Twitter, LinkedIn and Microsoft Windows.

Incorporating data from Movable Type into your Web Pages

This is a kinda tricky one, but it was based on some inspiration I got when working on my Real Life Debt Weblog: could I figure out a way to incorporate weblog data into non-blog pages? The answer is, yes!

For this experiment, I decided that I'd like to have a new sentence on the intuitive systems home page that always showed the two most recent entries in my intuitive life weblog...


Dave's Answer:

The first step was to go into the administrative area of Movable Type (a great weblogging tool written by sixapart that I use to run five different weblogs), and click on the "Templates" button on the left, then chose "create new index template".

The new page asked for the name of the new template, the target filename, and then offered an input box where I could enter the necessary HTML. I named the template "Latest Entries", the file "latest-entries.html", and added the following to the body:

<MTEntries lastn="2">
<a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a>,
</MTEntries>
That's all that was necessary to create a new file that is now automatically updated and recreated each time a new weblog entry is submitted. Not too hard, eh?

On the index page itself - index.shtml - I added the following few lines of HTML:

Don't forget to keep current on my weblog, where my latest
entries talk about
<!--#include virtual="blog/latest-entries.html"-->
and much more. Just visit
<a href="http://www.intuitive.com/blog/">The Intuitive
Life</a> and please feel free to add your own comments too.
If you check out the index page you'll see that the titles of the weblog entries just magically appear as if they were part of the regular typed-in material rather than automatically generated by Movable Type.

This is almost exactly the same technique I used on the Debtfree-Today Web site - a sister site to the real-life-debt site I mentioned earlier - to create an actual boxed element that has the latest five entries neatly listed in clickable form. If you can get this basic last-two-entries working, I'm sure you'll be able to get the more complex solution to rock too.



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

Great stuff Dave! I've been planning to do this for months but procrastinated because I didn't know how to pull it off. Once again, you've made life easier for me and about a million others. Thanks for another way to make our sites better!

Don Crowther, http://101PublicRelations.com

Posted by: 101PublicRelations.com at February 26, 2004 7:23 PM

Dave, this was a fantastic help! If I had known it was this easy, I would have added this feature to my site ages ago. I had gone down the rabbit hole of writing my own CGI script and everything, then thought, "you know, I bet Dave has a much simpler way of doing this..." So double thanks again.

Posted by: Josh Carter at October 27, 2005 6:20 PM

I have a lot to say, but ...
Starbucks coffee cup I have a lot to say, and questions of my own for that matter, but most of all I'd like to say thank you for all your efforts on this Web site by buying you a chai!

I do have a comment, now that you mention it!









Remember personal info?


Please note that I will never send you any unsolicited commercial email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.


Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Join the List!
Join my author info mailing list, where you'll learn about my upcoming books, speaking gigs, and more!


Book Links
© 2002 - 2008 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]