Time for action — properties and methods of the $model model object
The following exercise will show you how to use some properties and methods of the $model
object inside your custom template, along with some other data objects such as $weblog, $category
, and $entry:
Go to your custom template editing page, and replace the last three lines of code above the
</body></html>
line with the following lines:And these are the 5 most recent entries from each category in my weblog: </br> <table border="1"> <tr><td><b>Category</b></td><td><b>Entries</b></td></tr> #foreach ($category in $model.weblog.getWeblogCategory("nil"). weblogCategories) <tr><td><i>$category.name</i></td> <td> #foreach($entry in $model.weblog.getRecentWeblogEntries("$category .name", 5)) <a href="$entry.permalink">$entry.title</a><br> #end </td></tr> #end </table>
The entire...