Help - Search - Members - Calendar
Full Version: Linking Latest Entries To My Home Page
Movable Type Community Forum > Using Movable Type > Entries and Archives
stanleyd
My blog works great.
I also have a home page designed seperate from the blog.

Is it easy to display the latest blog entries on my main website home page?
Thanks.
caribou sue
Assuming you've created your home page in MT as well, yes, it's easy!

Wherever you want the entries to appear, put:
<ul>
<MTEntries lastn="3">
<li><a href="<MTEntryPermalink>"><MTEntryTitle></a></li>
</MTEntries>
</ul>

That's just a simple list of entry titles, but you can get much fancier. More info on template tags here:
http://www.movabletype.org/documentation/d...plate-tags.html

QUOTE (stanleyd @ Dec 4 2008, 12:17 PM) *
My blog works great.
I also have a home page designed seperate from the blog.

Is it easy to display the latest blog entries on my main website home page?
Thanks.

shenews
You can bring headline links into a site on another server. Make an index template and save it with a .js extension, e.g. 3blogheads.js

Put just this in the template:

CODE
<MTEntries lastn="3">
document.write('<a href="<$MTEntryLink$>"><$MTEntryTitle encode_js="1"$></a>');
</MTEntries>

Then link to it from your homepage like this (you can wrap this output in your own style for the name of the blog, a div for a bulleted list, etc.):
CODE
<script src="http://yourblogurl/3blogheads.js" type="text/javascript"></script>


This displays three headline permalinks; change the value of lastn to vary the number.

You can add a date at the end using the MT date syntax:

CODE
<MTEntries lastn="3">
document.write('<a href="<$MTEntryLink$>"><$MTEntryTitle encode_js="1"$></a> <font size="1"><$MTEntryDate format="%a %l:%M"$> <span style="text-transform: lowercase;"><$MTEntryDate format="%p"$></span></font>');
</MTEntries>

That produces this:
A weekend for winter veggies, art gifts Sat 9:16 AM

I haven't tried bringing in full entries, but I'd start here and play around with adding <MTEntryBody>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.