Does anyone know how to setup MonthlyArchive on entries on
Apple8217;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>
#set ($currentMonth =
$BLOJSOM_CALENDAR.getCurrentMonth() + 1)
#set ($totalMonths = 12)
#set ($currentYear = $BLOJSOM_CALENDAR.getCurrentYear())
#set ($padding = 0)
#foreach ($year in [$currentYear..$startingYear])
#set ($monthIndex = 1)
#if ($year == $startingYear)
#set($monthIndex = $startingMonth)
#end
#if ($year == $currentYear)
#set($totalMonths = $currentMonth)
#else
#set ($totalMonths = 12)
#end
#foreach ($month in [$totalMonths..$monthIndex])
#set ($calMonth = $month - 1)
<li><a href="#BlogURL()$year/#if($month
< 10)$padding#end$month/">$BLOJSOM_CALENDAR.getMonthName($calMonth)
$year</a></li>
#end
#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." - Albert Einstein.
|