Nothing to do. I thought to finally have created a Recent entries that updates when a New Entry is posted but i was unsuccessful.
Can, please, a MT guru say what is the method to have “Recent Entries” dynamic.
Many thanks.
Reported on Movable Type 4.2
Create an index template that outputs to a PHP file. Whenever your blog rebuilds, it will regenerate its index templates, which means a new entry will kick off the rebuilding of that PHP file. Something like this:
<?php
$entries = array();
<mt:Entries>
$entries[] = "<a href=\"<mt:EntryPermalink/>\"><mt:EntryTitle/></a>";
</mt:Entries>;
?>
You might want to set that index template up to published by a publishing queue so that it doesn't add time to normal rebuild processes.
Well, that got butchered, but I think you get the gist of what I was suggesting with that badly formatted code sample.
More precisely.. The singular thing is that the
blog/recent_entries.shtml
file contains all the recent entries and comments (3).
But the Main Index, is still reporting 2 Comments.
From "Main Index", let's go to the "Sidebar", and so on that until we arrive to the Widget "Recent Entries Expanded".
Now, what I've done is to clean the existant code and put in the Recent Entries Expanded widget this code:
No I see that the Widget isn't dynamically rebuilding. Why, if the code contains a file on the file system?
Mike, but that's already what I did :-)
When I wrote that I thought to have been successful, I mean that idea. Yesterday I've created an index template with that name:
Recent_Entries
This template contains the code to build the last 3 Entries (as results from the Recent Entries widget itself).
Then I set these options for the template:
Output file: blog/recent_entries.shtml
Template type: Custom Index Template
Link to File: (empty)
Publishing: Statically (default)
Then, of course, i mt:Included the file in the Sidebar.
There is something wrong with it? It doesn't work as it should. The index templates shouldn't rebuilt each time a new entry or comment is done?
If <mt:Include> does not generate a valid PHP include statement then it will just copy the raw text of that PHP file you generated into the other template you are building. That's why I suggested that you put something like the following in your widget manually just to be safe:
<?php
require_once('<$mt:BlogSitePath$>php_includes/recent_entries.php');
?>
No Mike, I don't see differences between the two choices. It's not a problem of language choosen, Php or other. The file is built dynamically. All correct: It contains the latest entries and comments!
But the "MICKEY_MOUSE" page shows it updated only when the "Mickey_Mouse" page is rebuilt! It is clear. When is rebuilt, the Main Index shows HOP! 3 comments. But the Category Page - to say one - not!
Why? Also the Category Page contains Sidebar that contains Recent Entries widget that contains Recent\_entries.shtml that contains 3 comments!