Posts Roller recent entries and comments

Roller recent entries and comments

According to Marcel’s request in a recent comment - here’s how I hacked the list of recent entries and comments on my blog.
It is based on someone else’s work (I forgot who).

Create two new Recent Entries and Comments template pages.

Recent Entries template:


    ` #set( $tamerMap = $pageModel.getRecentWeblogEntries(100, null) ) #foreach( $tamerDay in $tamerMap.keySet() ) #set( $tamerEntries = $tamerMap.get($tamerDay) ) #foreach( $tamerEntry in $tamerEntries ) #set( $tamerLink = "$ctxPath/page/$userName/$$tamerEntry.anchor" ) \<li\>\<a href="$tamerLink" title="$tamerEntry.title"\>$tamerEntry.title\</a\>\</li\> #end #end \</ul\> Recent Comments template: ` #if($website.allowComments)` \<ul\> #set( $tamerMap = $pageModel.getRecentWeblogEntries(25, nil) ) #foreach( $tamerDay in $tamerMap.keySet() ) #set( $tamerEntries = $tamerMap.get($tamerDay) ) #foreach( $tamerEntry in $tamerEntries ) #set( $sideCommentCount = $pageModel.getCommentCount($tamerEntry.Id)) #if( $sideCommentCount\>0) #set( $tamerLink = "$ctxPath/comments/$userName/$$tamerEntry.anchor" ) \<li\>[$sideCommentCount] \<a href=”$tamerLink”\>$tamerEntry.title\</a\> \</li\> #end #end #end \</ul\> #end Include these pages in their respective locations in the main weblog template through #includePage(”\<\_templateName\>”) It’s just a quick hack, there are better ways to do it (macros), and the pervious method will limit the number of entries according to the page you’re on (try clicking any of the old entries and check the new list) - but these will work for most of the cases. Also, there’s this [showRecentEntries]( macro definition that can be used - but I haven’t tried it. HTH.


Search Results