List Info

Thread: Monthly Archives on OS 10.4.8




Monthly Archives on OS 10.4.8
user name
2006-10-31 01:16:33

Does anyone know how to setup MonthlyArchive on entries on Apple’s rendition of Blojsom?

 

I have used the below code as found on one of the Apple̵7;s open source sites, but it doesn̵7;t work…;it actually prevents the blogs from loading completely.

 

#macro(MonthlyArchive $startingMonth $startingYear)

<ul>

 &nbsp;  #set ($currentMonth = $BLOJSOM_CALENDAR.getCurrentMonth() + 1)

 &nbsp;  #set ($totalMonths = 12)

 &nbsp;  #set ($currentYear = $BLOJSOM_CALENDAR.getCurrentYear())

 &nbsp;  #set ($padding = 0)

 &nbsp;  #foreach ($year in [$currentYear..$startingYear])

 &nbsp; &nbsp; &nbsp;  #set ($monthIndex = 1)

 &nbsp; &nbsp; &nbsp;  #if ($year == $startingYear)

 &nbsp; &nbsp; &nbsp; &nbsp;   ; #set($monthIndex = $startingMonth)

 &nbsp; &nbsp; &nbsp;  #end

 &nbsp; &nbsp; &nbsp;  #if ($year == $currentYear)

 &nbsp; &nbsp; &nbsp; &nbsp;   ; #set($totalMonths = $currentMonth)

 &nbsp; &nbsp; &nbsp;  #else

 &nbsp; &nbsp; &nbsp; &nbsp;   ; #set ($totalMonths = 12)

 &nbsp; &nbsp; &nbsp;  #end

 &nbsp; &nbsp; &nbsp;  #foreach ($month in [$totalMonths..$monthIndex])

 &nbsp; &nbsp; &nbsp; &nbsp;   ; #set ($calMonth = $month - 1)

 &nbsp;  <li><a href=";#BlogURL()$year/#if($month < 10)$padding#end$month/">$BLOJSOM_CALENDAR.getMonthName($calMonth) $year</a&gt;</li&gt;

 &nbsp; &nbsp; &nbsp;  #end

 &nbsp;  #end

</ul>;

#end

 

I am sure that there has to be a simpler way or doing this that actually works.

 

Thanks,

 

Milos

-
--

 

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.&quot; - Albert Einstein.

 

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )