Hi all, I've been building a MT website for the first time and have been figuring out solutions to most issues that have come up (and compromised on some to which I couldn't find answers) -- but it's clearly time to go to the experts.
I want my home page to always show whatever is the latest post, in full, exactly as-is.
I don't know how to get my Index template to do this. It seems to me that the mt:Include tag can only be used to pull template modules, not full templates. Which makes sense, since it's imbedded in the middle of an otherwise full page.
I suspect that in order to achieve this the Index template should be very simple, maybe just a couple lines of code.
Please let me know if you have a solution.
Best, we
Reported on Movable Type 4.2
If you're discussing blog posts, the code to include entries *is* in modules. Here's the basic idea: In your Main Index template,
<mt:Entries lastn="1">
<$MTInclude module="Entry Detail"$>
</mt:Entries>
<mt:Entries lastn="6" offset="1">
<$MTInclude module="Entry Summary"$>
</mt:Entries>
The offset on the second statement starts listing non-complete posts with number 2. You can make them just headlines if you like by copying the Entry Summary template module to one called something like Entry Titles, and removing MTEntryBody. Then use that in your second statement.
If your Entry Detail template also includes the comment form and you don't want that, make another without it, call it Entry Detail Only or somesuch, and include that instead in the first statement.
Thanks for the reply, shenews. Unfortunately this isn't working. To clarify, these are indeed blog posts.
When I started building this website a few weeks ago, I started by making a mock-up in Photoshop of what a typical blog post would look like. Then I started creating this post in MT. It is based on the Archive template "Entry". This (and each future) entry has a number of custom fields that go into widgets, that go into the sidebar. So each entry comprises "alpha" and "beta" components. "Gamma" is always the same, no matter the post.
I want each latest post to be the de facto homepage of the website.
So that's some more background.
I don't have a template module called "Entry Detail" in my list of template modules. Would this work if I were to create one -- and if so, how do I direct it to contain the entire most recent Archive Entry?
Thanks in advance, we
MT 4.2 default templates, including Entry Detail, are here: http://www.movabletype.org/default_templates/4.2/
Main Index, index.html, is your default homepage. Entry is your permalink, the code used to display each of your standalone blog posts (this is what search engines find). The default Entry templates contains <$MTInclude module="Entry Detail"$>.
You can probably copy your layout to Main Index, and use only the first statement of the code I mentioned before. This will display only your latest Entry, and will automatically update with each new post.
Thank you again for your response! Unfortunately, this is still not working for me. In fact, the default main index template is closer to what I want as-is. I think I haven't explained the issue well enough, so I have put 2 screengrabs with labels up on Flickr to show what's going on. The link: http://www.flickr.com/photos/39960698@N02/
The graphic "archive-entry-w-labels" shows what my test blog post looks like. You can see that there is conent being fed into the sidebar through the entry's custom fields.
The second graphic is called "main-index-w-labels". This shows what my "main index" template is currently returning. I have not modified this template at all. As I mentioned in a previous post, what I want my main index template to do is to return the most recent post including the custom fields. The default template as-is is ALMOST doing this, but you can see that the custom fields in the left sidebar (which are fed into unique template modules, then unique widgets, and then into the sidebar) have no content in them -- the data from the entry's custom fields is not coming through.
Please let me know if you have any ideas on how I can get those custom fields to show up in the main index template.
Thanks in advance, we
PHEW. OK, I got it. The shenews advice was right on. Here's what I did, in case anybody runs has similar questions.
I copied all the code from the Entry archive template, from "" down, stopping short of the tag. I pasted this into the "Entry Summary" template module, replacing everything that was in there.
Then in my Main Index template, I removed all the code after the "" tag, up to the "" tag. In its place I put shenews' code -- the first example at the top of this thread. I changed "Entry Detail" to "Entry Summary" since that is the module I'm calling, and voila. The main index shows the most recent post in its entirety.
Thanks again for your help, shenews.
Hm, OK, now I'll try this using the Encoder:
PHEW. OK, I got it. The shenews advice was right on. Here's what I did, in case anybody runs has similar questions.
I copied all the code from the Entry archive template, from
down, stopping short of the tag. I pasted this into the "Entry Summary" template module, replacing everything that was in there. Then in my Main Index template, I removed all the code after the tag, down to the tag. In its place I put shenews' code -- the first example at the top of this thread. I changed "Entry Detail" to "Entry Summary" since that is the module I'm calling, and voila. The main index shows the most recent post in its entirety.Thanks again for your help, shenews.
Glad it worked for you, withexit. MT is really flexible about how you can put the pieces together.