Welcome!

Search





Page: ShowRecentEntries


To be able to show the list of the last x entries the following is needed :

a. You need to add the following macro definition to one of the velocity macro templates :

#macro( showRecentEntries $pageName $maxEntries )
  #set( $recentTemplateId = $vHelper.getPageIdByName($pageName) )
     #set( $map = $vHelper.getRecentWeblogEntries( $maxEntries ) )
       #foreach( $day in $map.keySet() )
           #set( $entries = $map.get($day) )
           #parse( $recentTemplateId )
       #end
#end

I added it to the website.vm , this is not possible for normal users, it has to be added by the sysadmin so freeroller users will have to ask for it. Best would be to include this in the website.vm in the Roller source.

b. As weblog user create a template page called _recent_entries using the Weblog administration console under 'Weblog:Pages' :

#foreach ($var in $entries)
 <a href="$baseURL/page/$userName/#formatDate($plainFormat $var.PubTime )#$var.Anchor")> -  $var.title</a><br/>
#end

c. In the template where you want to display the list of recent entries add :

#showRecentEntries ( "_recent_entries" 10 )

For a version that doesn't require creating a new template page, see Lance's entry.

Add new attachment

In order to upload a new attachment to this page, please use the following box to find the file, then click on “Upload”.
« This page (revision-1) was last changed on 11-Aug-2003 12:36 by UnknownAuthor